aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions_user.inc.php
diff options
context:
space:
mode:
authorrub <rub@piwigo.org>2006-03-16 22:58:16 +0000
committerrub <rub@piwigo.org>2006-03-16 22:58:16 +0000
commit9b521760af7639310742d7817c4fb91b88471c5c (patch)
tree9260a834a927131ba184de330d4f8ecdfaafdcef /include/functions_user.inc.php
parent5980db248ab4cc05e8596e07d7efc31048bcb8e8 (diff)
Step 7 improvement issue 0000301:
o can attribute status <= current user o define mode adviser => buttons disabled (gray on IE, not on FF) => truncated actions => display info mode adviser git-svn-id: http://piwigo.org/svn/trunk@1085 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/functions_user.inc.php')
-rw-r--r--include/functions_user.inc.php31
1 files changed, 26 insertions, 5 deletions
diff --git a/include/functions_user.inc.php b/include/functions_user.inc.php
index 44f1a1cf7..7af517980 100644
--- a/include/functions_user.inc.php
+++ b/include/functions_user.inc.php
@@ -548,11 +548,11 @@ function log_user($user_id, $remember_me)
}
/*
- * Return if current user have access to access_type definition
+ * Return access_type definition of uuser
* Test does with user status
* @return bool
*/
-function is_autorize_status($access_type, $user_status = '')
+function get_access_type_status($user_status = '')
{
global $user;
@@ -587,11 +587,21 @@ function is_autorize_status($access_type, $user_status = '')
}
}
- return ($access_type_status >= $access_type);
+ return $access_type_status;
+}
+
+/*
+ * Return if user have access to access_type definition
+ * Test does with user status
+ * @return bool
+*/
+function is_autorize_status($access_type, $user_status = '')
+{
+ return (get_access_type_status($user_status) >= $access_type);
}
/*
- * Check if current user have access to access_type definition
+ * Check if user have access to access_type definition
* Stop action if there are not access
* Test does with user status
* @return none
@@ -609,7 +619,7 @@ function check_status($access_type, $user_status = '')
}
/*
- * Return if current user is an administrator
+ * Return if user is an administrator
* @return bool
*/
function is_admin($user_status = '')
@@ -617,4 +627,15 @@ function is_admin($user_status = '')
return is_autorize_status(ACCESS_ADMINISTRATOR, $user_status);
}
+/*
+ * Return if current user is an adviser
+ * @return bool
+*/
+function is_adviser()
+{
+ global $user;
+
+ return ($user['adviser'] == 'true');
+}
+
?> \ No newline at end of file