------------------------------------------------------------
revno: 1008
committer: bassel <[email protected]>
branch nick: aikiframework
timestamp: Sat 2012-01-07 22:46:13 +0200
message:
more clean up while fixing the login bug
modified:
libs/membership.php
libs/widgets.php
--
lp:aikiframework
https://code.launchpad.net/~aikiframework-devel/aikiframework/trunk
Your team Aiki Framework Developers is subscribed to branch lp:aikiframework.
To unsubscribe from this branch go to
https://code.launchpad.net/~aikiframework-devel/aikiframework/trunk/+edit-subscription
=== modified file 'libs/membership.php'
--- libs/membership.php 2012-01-07 19:59:33 +0000
+++ libs/membership.php 2012-01-07 20:46:13 +0000
@@ -197,6 +197,7 @@
" `user_session`!='" . $_SESSION['aikiuser'] . "' and `user_name` = '" .
$get_user->username . "' and `user_id`='" . $get_user->userid . "'");
}
+
$this->getUserPermissions($get_user->username);
$update_acces = $db->query("UPDATE `aiki_users` SET `last_login`= NOW(),`last_ip`='$user_ip'," .
@@ -249,14 +250,17 @@
"JOIN aiki_users_groups ON aiki_users.usergroup= aiki_users_gr".
"oups.id WHERE aiki_users.username='$user' AND user_session=".
"'$session'";
- $user = $db->get_row($SQL);
+ $user = $db->get_row($SQL);
+
if ( $user ) {
+
$this->full_name = $user->full_name;
$this->username = $user->username;
$this->userid = $user->userid;
$this->group_level = $user->group_level;
$this->permissions = $user->group_permissions;
} else {
+
$this->permissions = "";
//unset the browser session if the session
@@ -296,6 +300,7 @@
public function have_permission($permission="SystemGOD") {
global $db;
+
if ( $permission=="SystemGOD" ) {
return $this->permissions == "SystemGOD";
} elseif ( $permission == $this->permissions ) {
=== modified file 'libs/widgets.php'
--- libs/widgets.php 2012-01-07 19:59:33 +0000
+++ libs/widgets.php 2012-01-07 20:46:13 +0000
@@ -338,14 +338,16 @@
$stopcaching = true;
}
- // Security check to determine which widget content to display.
+ // Security check to determine which widget content to display.
+ //echo $widget->is_admin."-".$membership->permissions."-".$widget->if_authorized."<br>";
if ( $widget->is_admin
&& $membership->permissions
&& $widget->if_authorized
&& $membership->have_permission($widget->permissions) ) {
$widget->widget = $widget->if_authorized;
$widget->normal_select = $widget->authorized_select;
- $stopcaching = true;
+ $stopcaching = true;
+
}
if ( !$stopcaching and
@@ -536,15 +538,13 @@
$processed_widget = $this->parse_translate_aiki_core($processed_widget);
$processed_widget = $this->parse_translate_widget($processed_widget);
// Apply (#(header:...
+
$processed_widget = $this->parse_header($processed_widget);
$processed_widget = $aiki->Forms->displayForms($processed_widget);
$processed_widget = $aiki->input->requests($processed_widget);
$processed_widget = $aiki->AikiScript->parser($processed_widget);
-
-
//$processed_widget = stripslashes($processed_widget);
-
}
@@ -621,6 +621,7 @@
return $processed_widget;
}
} else {
+
$this->widget_html .= $processed_widget;
}
} // end of createWidgetContent()
_______________________________________________
Mailing list: https://launchpad.net/~aikiframework-devel
Post to : [email protected]
Unsubscribe : https://launchpad.net/~aikiframework-devel
More help : https://help.launchpad.net/ListHelp