/** * Any user who has access to the scheduler module is added to receive a * notification. */ protected function loadUsers() { foreach (User::getActiveUsers(true) as $user) { if ($user->getEffectiveRight('JobsManagerModule', JobsManagerModule::RIGHT_ACCESS_JOBSMANAGER) == Right::ALLOW) { $this->addUser($user); } } }
/** * Any user who has access to the workflows module is added to receive a * notification. */ protected function loadUsers() { foreach (User::getActiveUsers() as $user) { if ($user->getEffectiveRight('WorkflowsModule', WorkflowsModule::RIGHT_ACCESS_WORKFLOWS) == Right::ALLOW) { $this->addUser($user); } } }
da, ca, ra, sarank, darank, carank, rarank, up, numofficers FROM User WHERE active = 1; ") or die("1:".mysql_error()); $users = User::getActiveUsers(false, false); $nusers = count($users); $i = 0; foreach($users as $user) { echo "resetscript: (" . round(($i / $nusers)*100, 2) . "%) calculating user ($user->id:$user->username)\n"; $i++; $ret = null; $q = mysql_query("select sum(goldStolen) as retCode from BattleLog where attackerId = $user->id") or die(mysql_error()); $a = mysql_fetch_object($q); $ret->goldTaken = (float)$a->retCode; $q = mysql_query("select sum(goldStolen) as retCode from BattleLog where targetId = $user->id") or die(mysql_error()); $a = mysql_fetch_object($q); $ret->goldLost = (float)$a->retCode;
'page' => FILTER_VALIDATE_INT | FILTER_SANITIZE_NUMBER_INT, 'search' => FILTER_SANITIZE_STRING, 'search-type' => FILTER_VALIDATE_INT | FILTER_SANITIZE_NUMBER_INT, 'area' => FILTER_VALIDATE_INT | FILTER_SANITIZE_NUMBER_INT, ); $filteredG = filter_input_array(INPUT_GET, $filter); if ($filteredG['area']) { $area = $filteredG['area'] ? max(1, min($filteredG['area'], $conf['area-count'] + 1 )) : 1; } else { $area = $user->area; } if ($area == $conf['area-count'] + 1) { $area = '*'; } $t->page = $filteredG['page'] ? max($filteredG['page'], 1) : 1; $t->user = $user; $t->users = User::getActiveUsers($t->page, 0, $filteredG['search'], $filteredG['search-type'], $area); $t->usersCount = User::getActiveUsersCount(0, $filteredG['search'], $filteredG['search-type'], $area); $t->totalPages = ceil($t->usersCount / $conf['users-per-page']); $t->search = $filteredG['search' ]; $t->searchType = $filteredG['search-type']; $t->area = $area; $t->pageTitle = 'Battlefield'; $t->display(); ?>
private static function upgradeUserPreferences() { $users = User::getActiveUsers(); foreach ($users as $user_id => $user_name) { $user = new User(); $user->retrieve($user_id); $preferencePopupReminderTime = $user->getPreference('reminder_time'); $preferenceEmailReminderTime = $user->getPreference('email_reminder_time'); $preferencePopupReminderChecked = $preferencePopupReminderTime > -1; $preferenceEmailReminderChecked = $preferenceEmailReminderTime > -1; $user->setPreference('reminder_checked', $preferencePopupReminderChecked); $user->setPreference('email_reminder_checked', $preferenceEmailReminderChecked); } }
?> <?php echo $form->dropDownListRow($model, 'project_id', Project::getActiveProjects()); ?> <?php echo $form->radioButtonListRow($model, 'tracker_id', Issue::getTrackerOptions()); ?> <?php echo $form->dropDownListRow($model, 'priority_id', Issue::getPriorityOptions()); ?> <?php echo $form->dropDownListRow($model, 'assigned_to_id', User::getActiveUsers(), array('empty' => ' - ')); ?> <?php echo $form->textFieldRow($model, 'subject', array('class' => 'span5', 'maxlength' => 50)); ?> <div class="control-group"> <?php echo $form->labelEx($model, 'description', array('class' => 'control-label')); ?> <div class="controls"> <?php $this->widget('application.extensions.tinymce.ETinyMce', array('model' => $model, 'attribute' => 'description', 'editorTemplate' => 'custom', 'language' => 'ru', 'height' => '200px')); ?> </div>
World War II MMORPG Copyright (C) 2009-2010 Richard Eames This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. ***/ $incron = true; ini_set('include_path', '.:/home/ww2game/public_html/scripts/:/home/ww2game/public_html/'); include('vsys.php'); $users = User::getActiveUsers(); foreach ($users as $u) { $u->clicks = 0; $u->save(); } ?>
<?php $ADMIN_SECTION = 'dashboard'; require_once dirname(__FILE__) . '/header.php'; $total_users = User::getTotalUsers(); $active_users = User::getActiveUsers(); $data = ''; $legend = ''; $legend_colors = ''; $labels = ''; $regs = User::getRecentRegistrationsByModule(); $totalregs = 0; foreach (UserConfig::$authentication_modules as $module) { $module_id = $module->getID(); if (array_key_exists($module_id, $regs)) { $totalregs += $regs[$module_id]; } } $firstmodule = true; foreach (UserConfig::$authentication_modules as $module) { $module_id = $module->getID(); if (!array_key_exists($module_id, $regs) || $regs[$module_id] == 0) { continue; } if (array_key_exists($module->getID(), $regs)) { $data .= (!$firstmodule ? ',' : '') . sprintf('%.1f', $regs[$module->getID()] * 100 / $totalregs); $legend .= (!$firstmodule ? '|' : '') . $module->getTitle() . ' (' . sprintf('%.1f', $regs[$module->getID()] * 100 / $totalregs) . '%)'; $legend_colors .= (!$firstmodule ? '|' : '') . $module->getLegendColor(); $labels .= (!$firstmodule ? '|' : '') . $module->getTitle(); } else { echo 0;
public function testGetAllUsersAndGetActiveUsers() { $all_users = User::getAllUsers(); $this->assertTrue(is_array($all_users)); $active_users = User::getActiveUsers(); $this->assertTrue(is_array($active_users)); $this->assertGreaterThanOrEqual(count($active_users), count($all_users)); }
/** * generate form: new message * * @return string html code for the form * @author Elias Müller **/ private function getForm() { $tpl = new Template('message'); $el = $this->s->element != '' ? $this->s->element : false; switch ($this->s->action) { case 'update': $m = Message::getInstance($this->s->element); break; case 'reply': $r = Message::getInstance($this->s->element); $m = new Message(); $m->subject = 'Re: ' . $r->subject; $m->receiver = $r->sender === $this->s->user ? $r->receiver : $r->sender; if ($r->replyto != 0) { $el = $r->replyto; } break; } $tpl->assign('message', $m); $tpl->assign('action', $this->s->action); $tpl->assign('id', $el); $tpl->assign('user', User::getActiveUsers()); return $tpl->fetch('form_message.html'); }
public function testActiveUsers() { $activeUserCount = User::getActiveUserCount(); $this->assertEquals(28, $activeUserCount); $this->assertCount(28, User::getActiveUsers()); $activeUserCount = User::getActiveUserCount(false); $this->assertEquals(28, $activeUserCount); $this->assertCount(28, User::getActiveUsers(false)); $activeUserCount = User::getActiveUserCount(true); $this->assertEquals(28, $activeUserCount); $this->assertCount(28, User::getActiveUsers(true)); $user = User::getByUsername('rootuser'); $this->assertTrue(UserAccessUtil::resolveCanCurrentUserAccessRootUser($user)); $user->setIsRootUser(); $this->assertTrue($user->save()); unset($user); $activeUserCount = User::getActiveUserCount(); $this->assertEquals(27, $activeUserCount); $this->assertCount(27, User::getActiveUsers()); $activeUserCount = User::getActiveUserCount(false); $this->assertEquals(27, $activeUserCount); $this->assertCount(27, User::getActiveUsers(false)); $activeUserCount = User::getActiveUserCount(true); $this->assertEquals(28, $activeUserCount); $this->assertCount(28, User::getActiveUsers(true)); }
/** * Create user list * * @return string HTML-Code for user list */ private function listUsers() { $users = User::getActiveUsers(); $tpl = new Template('user'); $tpl->assign('users', $users); $tpl->assign('id', $this->s->user->id); $tpl->assign('call', $this->s->post['call']); $tpl->assign('permissions', array('update' => $this->s->user->hasRights("user:update"), 'delete' => $this->s->user->hasRights("user:delete"), 'create' => $this->s->user->hasRights("user:create"))); return $tpl->fetch('users_table.html'); }