Minor - format code.

ofaj
jmontoyaa 10 years ago
parent 496adcef6f
commit 66192c67e4
  1. 4
      main/admin/user_list.php
  2. 35
      main/inc/lib/usermanager.lib.php

@ -688,8 +688,8 @@ if (!empty($action)) {
$number_of_deleted_users = 0; $number_of_deleted_users = 0;
if (is_array($_POST['id'])) { if (is_array($_POST['id'])) {
foreach ($_POST['id'] as $index => $user_id) { foreach ($_POST['id'] as $index => $user_id) {
if($user_id != $_user['user_id']) { if ($user_id != $_user['user_id']) {
if(UserManager :: delete_user($user_id)) { if (UserManager::delete_user($user_id)) {
$number_of_deleted_users++; $number_of_deleted_users++;
} }
} }

@ -459,6 +459,7 @@ class UserManager
)); ));
$hook->notifyCreateUser(HOOK_EVENT_TYPE_POST); $hook->notifyCreateUser(HOOK_EVENT_TYPE_POST);
} }
return $return; return $return;
} }
@ -649,9 +650,6 @@ class UserManager
WHERE lastedit_user_id = '".$user_id."'"; WHERE lastedit_user_id = '".$user_id."'";
Database::query($sql); Database::query($sql);
// Delete user from database // Delete user from database
$sql = "DELETE FROM $table_user WHERE id = '".$user_id."'"; $sql = "DELETE FROM $table_user WHERE id = '".$user_id."'";
Database::query($sql); Database::query($sql);
@ -690,7 +688,7 @@ class UserManager
* @assert (-1) === false * @assert (-1) === false
* @assert (array(-1)) === false * @assert (array(-1)) === false
*/ */
static function delete_users($ids = array()) public static function delete_users($ids = array())
{ {
$result = false; $result = false;
$ids = is_array($ids) ? $ids : func_get_args(); $ids = is_array($ids) ? $ids : func_get_args();
@ -715,7 +713,7 @@ class UserManager
* @assert (null) === false * @assert (null) === false
* @assert (array(-1)) === false * @assert (array(-1)) === false
*/ */
static function deactivate_users($ids = array()) public static function deactivate_users($ids = array())
{ {
if (empty($ids)) { if (empty($ids)) {
return false; return false;
@ -745,7 +743,7 @@ class UserManager
* @assert (null) === false * @assert (null) === false
* @assert (array(-1)) === false * @assert (array(-1)) === false
*/ */
static function activate_users($ids = array()) public static function activate_users($ids = array())
{ {
if (empty($ids)) { if (empty($ids)) {
return false; return false;
@ -1271,6 +1269,7 @@ class UserManager
while ($row = Database::fetch_array($rs)) { while ($row = Database::fetch_array($rs)) {
$result[] = $row; $result[] = $row;
} }
return $result; return $result;
} }
@ -1282,8 +1281,12 @@ class UserManager
* @todo optional course code parameter, optional sorting parameters... * @todo optional course code parameter, optional sorting parameters...
* @todo security filter order by * @todo security filter order by
*/ */
public static function get_user_list($conditions = array(), $order_by = array(), $limit_from = false, $limit_to = false) public static function get_user_list(
{ $conditions = array(),
$order_by = array(),
$limit_from = false,
$limit_to = false
) {
$user_table = Database :: get_main_table(TABLE_MAIN_USER); $user_table = Database :: get_main_table(TABLE_MAIN_USER);
$return_array = array(); $return_array = array();
$sql_query = "SELECT * FROM $user_table"; $sql_query = "SELECT * FROM $user_table";
@ -1319,8 +1322,12 @@ class UserManager
* @todo optional course code parameter, optional sorting parameters... * @todo optional course code parameter, optional sorting parameters...
* @todo security filter order_by * @todo security filter order_by
*/ */
public static function get_user_list_like($conditions = array(), $order_by = array(), $simple_like = false, $condition = 'AND') public static function get_user_list_like(
{ $conditions = array(),
$order_by = array(),
$simple_like = false,
$condition = 'AND'
) {
$user_table = Database :: get_main_table(TABLE_MAIN_USER); $user_table = Database :: get_main_table(TABLE_MAIN_USER);
$return_array = array(); $return_array = array();
$sql_query = "SELECT * FROM $user_table"; $sql_query = "SELECT * FROM $user_table";
@ -1442,7 +1449,7 @@ class UserManager
try { try {
mkdir($rootPath, $perm); mkdir($rootPath, $perm);
} catch (Exception $e) { } catch (Exception $e) {
// error_log($e->getMessage());
} }
} }
} }
@ -1511,7 +1518,6 @@ class UserManager
} }
$gravatarEnabled = api_get_setting('gravatar_enabled'); $gravatarEnabled = api_get_setting('gravatar_enabled');
$anonymousPath = Display::returnIconPath('unknown.png', $pictureAnonymousSize); $anonymousPath = Display::returnIconPath('unknown.png', $pictureAnonymousSize);
if ($pictureWebFile == 'unknown.jpg' || empty($pictureWebFile)) { if ($pictureWebFile == 'unknown.jpg' || empty($pictureWebFile)) {
@ -1804,8 +1810,8 @@ class UserManager
/** /**
* Remove a user production. * Remove a user production.
* *
* @param int $user_id User id * @param int $user_id User id
* @param string $production The production to remove * @param string $production The production to remove
*/ */
public static function remove_user_production($user_id, $production) public static function remove_user_production($user_id, $production)
{ {
@ -2053,6 +2059,7 @@ class UserManager
{ {
$extraField = new ExtraField('user'); $extraField = new ExtraField('user');
$data = $extraField->get_handler_field_info_by_field_variable($variable); $data = $extraField->get_handler_field_info_by_field_variable($variable);
return empty($data) ? true : false; return empty($data) ? true : false;
} }

Loading…
Cancel
Save