*
* License: http://www.gnu.org/licenses/gpl.txt (GPL) *
******************************************************************************
* This file is part of "TaskFreak! multi user" program. *
* *
* TaskFreak! multi user 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 2 of the License, or (at *
* your option) any later version. *
* *
* TaskFreak! multi user 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, write to the Free Software *
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA *
\****************************************************************************/
include '_common.php';
if (!$objUser->checkLevel(1)) {
Tzn::redirect('logout.php','ERROR:'.$langMessage['denied']);
}
$pLink = 'user_list.php';
/* --- DELETE MEMBER ------------------------------------------------- */
if ($_REQUEST['mode']) {
$objItem = new Member();
$objItem->setUid($_REQUEST['mode']);
if ($objItem->id) {
$objItem->load();
if ((($objUser->checkLevel(3)) || ($objUser->id == $objItem->author->id))
&& ($objUser->id != $objItem->id))
{
// user is administrator or creator of user and not himself
if ($objItem->enabled) {
$objItem->enabled = 0;
} else {
$objItem->enabled = 1;
}
$objItem->update('enabled');
//Tzn::redirect('user_list.php');
}
}
}
if ($_REQUEST['delete']) {
$objItem = new Member();
$objItem->setUid($_REQUEST['delete']);
if ($objItem->id) {
if (($objUser->checkLevel(3)) && ($objUser->id != $objItem->id)) {
// user is administrator and is not himself
$objItem->delete();
//Tzn::redirect('user_list.php');
}
}
}
/* --- LOAD MEMBERS --------------------------------------------------- */
$objItemList = new Member();
// --- search criterions ---
if ($sName = $_REQUEST['keyword']) {
if (ereg('^".*"$',$sName)) {
$hParam = str_replace('"','',$sName);
} else if (ereg('\*',$iName)) {
$hParam = str_replace('*','%',$sName);
} else {
$hParam = '%'.str_replace(' ','%',$sName).'%';
}
$objItemList->addWhere("(CONCAT(firstName,' ',middleName,' ',lastName) LIKE '$hParam' "
."OR username LIKE '$hParam')");
}
if ($sCountry = Tzn::getReg($_REQUEST['country'],'^[A-Z]+$')) {
$objItemList->addWhere("member.countryId='".$sCountry."'");
}
if ($sState = Tzn::getReg($_REQUEST['state'],'^[A-Z]+$')) {
$objItemList->addWhere("member.stateCode='".$sState."'");
}
// --- load ---
$objItemList->addOrder('level DESC,lastName ASC');
$objItemList->loadList();
// --- INIT POSITIONS --------
$objPositionList = new GlobalPositionList();
/* --- HTML ----------------------------------------------------------- */
$pageJScript = 'common.js';
include PRJ_INCLUDE_PATH.'html/header.php';
?>
|
|
|
|
checkLevel(2)) {
?> |
rNext()) {
if ($objItem->enabled) {
$rowStyle = '';
$imgStatus = 'ena';
} else {
$rowStyle = ' class="disabled"';
$imgStatus = 'dis';
}
?>
>
getName();
?> |
getLocation(); ?> |
getPosition($objItem->level); ?> |
getDtm('lastLoginDate','SHX','user','-'); ?> |
checkLevel(3)) || ($objUser->id == $objItem->id) || ($objUser->id == $objItem->author->id)) {
if ($objUser->id != $objItem->id) {
?>
checkLevel(5)) {
?>
|