Merge branch 'master' of github.com:shish/shimmie2

This commit is contained in:
Shish 2012-03-12 17:33:48 +00:00
commit 357b298122
3 changed files with 10 additions and 7 deletions

View file

@ -64,8 +64,8 @@ define("EXTRA_USER_CLASSES", serialize(array(
"admin", # class to base it on "admin", # class to base it on
array( # parts of the base class to override array( # parts of the base class to override
"override_config" => False, "override_config" => False,
"change_password" => False, "edit_user_password" => False,
"change_user_info" => False, "edit_user_info" => False,
"delete_user" => False, "delete_user" => False,
"manage_extension_list" => False, "manage_extension_list" => False,
) )

View file

@ -29,14 +29,17 @@ class UserClass {
} }
} }
// action_object_attribute
// action = create / view / edit / delete
// object = image / user / tag / setting
$_user_class_base = new UserClass("base", null, array( $_user_class_base = new UserClass("base", null, array(
"change_setting" => False, # modify web-level settings, eg the config table "change_setting" => False, # modify web-level settings, eg the config table
"override_config" => False, # modify sys-level settings, eg config.php "override_config" => False, # modify sys-level settings, eg config.php
"big_search" => False, # search for more than 3 tags at once (speed mode only) "big_search" => False, # search for more than 3 tags at once (speed mode only)
"view_ip" => False, # view IP addresses associated with things "view_ip" => False, # view IP addresses associated with things
"ban_ip" => False, "ban_ip" => False,
"change_password" => False, "edit_user_password" => False,
"change_user_info" => False, # email address, etc "edit_user_info" => False, # email address, etc
"delete_user" => False, "delete_user" => False,
"delete_image" => False, "delete_image" => False,
"delete_comment" => False, "delete_comment" => False,
@ -70,8 +73,8 @@ $_user_classes["admin"] = new UserClass("admin", $_user_class_base, array(
"lock_image" => True, "lock_image" => True,
"view_ip" => True, "view_ip" => True,
"ban_ip" => True, "ban_ip" => True,
"change_password" => True, "edit_user_password" => True,
"change_user_info" => True, "edit_user_info" => True,
"delete_user" => True, "delete_user" => True,
"delete_image" => True, "delete_image" => True,
"delete_comment" => True, "delete_comment" => True,

View file

@ -149,7 +149,7 @@ class UserPageTheme extends Themelet {
$page->add_block(new Block("Stats", join("<br>", $stats), "main", 0)); $page->add_block(new Block("Stats", join("<br>", $stats), "main", 0));
if(!$user->is_anonymous()) { if(!$user->is_anonymous()) {
if($user->id == $duser->id || $user->can("change_user_info")) { if($user->id == $duser->id || $user->can("edit_user_info")) {
$page->add_block(new Block("Options", $this->build_options($duser), "main", 20)); $page->add_block(new Block("Options", $this->build_options($duser), "main", 20));
} }
} }