mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-13 04:53:26 +00:00
Coding standards
This commit is contained in:
@@ -42,7 +42,7 @@ class module_admin_route_users
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function export(Symfony\Component\HttpFoundation\Request $request)
|
||||
{
|
||||
$appbox = appbox::get_instance();
|
||||
@@ -143,8 +143,8 @@ class module_admin_route_users
|
||||
if (is_null($v))
|
||||
$this->query_parms[$k] = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$query = new User_Query($appbox);
|
||||
$templates = $query
|
||||
->only_templates(true)
|
||||
|
@@ -183,7 +183,7 @@ class module_admin_route_users_edit
|
||||
$templates = $query
|
||||
->only_templates(true)
|
||||
->execute()->get_results();
|
||||
|
||||
|
||||
$this->users_datas = $rs;
|
||||
$out = array(
|
||||
'datas' => $this->users_datas,
|
||||
@@ -543,7 +543,7 @@ class module_admin_route_users_edit
|
||||
}
|
||||
|
||||
$users = $this->users;
|
||||
|
||||
|
||||
$user = User_adapter::getInstance(array_pop($users), appbox::get_instance());
|
||||
|
||||
if ($user->is_template() || $user->is_special())
|
||||
@@ -594,29 +594,29 @@ class module_admin_route_users_edit
|
||||
{
|
||||
$appbox = appbox::get_instance();
|
||||
$session = $appbox->get_session();
|
||||
|
||||
|
||||
$template = \User_adapter::getInstance($this->request->get('template'), $appbox);
|
||||
|
||||
if ($template->get_template_owner()->get_id() != $session->get_usr_id())
|
||||
{
|
||||
throw new \Exception_Forbidden('You are not the owner of the template');
|
||||
}
|
||||
|
||||
|
||||
$current_user = \User_adapter::getInstance($session->get_usr_id(), $appbox);
|
||||
$base_ids = array_keys($current_user->ACL()->get_granted_base(array('canadmin')));
|
||||
|
||||
foreach ($this->users as $usr_id)
|
||||
{
|
||||
$user = \User_adapter::getInstance($usr_id, $appbox);
|
||||
|
||||
|
||||
if($user->is_template())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
$user->ACL()->apply_model($template, $base_ids);
|
||||
}
|
||||
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user