<?php /** * Created by PhpStorm. * User: Hoan * Date: 10/15/2015 * Time: 3:06 PM */ session_start(); //Kiểm tra đăng nhập nếu chưa đăng nhập thì quay về trang đăng nhập if (!isset($_SESSION['user'])) { header('location:login.php'); } //Add các file cần thiết require '../../configs/config.php'; require '../../libraries/connect.php'; require '../../models/user.php'; //Lấy danh sách thành viên $user_list = GetUserList(); //Trang giao diện require '../../views/admin/user/v_listuser.php';
* Created by PhpStorm. * User: Hoan * Date: 10/17/2015 * Time: 6:00 PM */ session_start(); if (!isset($_SESSION['user'])) { header('location:login.php'); } //Add các file cần thiết require '../../configs/config.php'; require '../../libraries/connect.php'; require '../../models/user.php'; $flag = 0; if ($_POST) { $list_user = GetUserList(); while ($users = mysql_fetch_assoc($list_user)) { if ($users['username'] == $_POST['username']) { $flag = 1; } if ($users['email'] == $_POST['email']) { $flag = 2; } } if ($flag == 0) { $data = array('username' => $_POST['username'], 'password' => $_POST['password'], 'fullname' => $_POST['fullname'], 'email' => $_POST['email'], 'status' => isset($_POST['status']) ? 1 : 0, 'created' => date('Y-m-d H:i:s'), 'modified' => date('Y-m-d H:i:s')); if (AddUser($data)) { //Tạo cờ lưu thông báo thành công $_SESSION['success'] = true; //header('location:add.php'); // Tải lại trang để reset form }
} //更新字段 else if($dopost=='update') { $dsql->ExecuteNoneQuery("Update dedecms_users set url='$url',version='$version',rank='$rank',isok='$isok',ismember='$ismember' where aid='$aid';"); AjaxHead(); GetUserList($dsql,$pageno,$pagesize,$orderby); $dsql->Close(); exit(); } //删除字段 else if($dopost=='del') { $dsql->ExecuteNoneQuery("Delete From dedecms_users where aid='$aid';"); AjaxHead(); GetUserList($dsql,$pageno,$pagesize,$orderby); $dsql->Close(); exit(); } //第一次进入这个页面 if($dopost==''){ $row = $dsql->GetOne("Select count(*) as dd From dedecms_users"); $totalRow = $row['dd']; include(dirname(__FILE__)."/templets/dedecms_user_main.htm"); $dsql->Close(); } //获得列表 //--------------------------------- function GetUserList($dsql,$pageno,$pagesize,$orderby='aid'){
include_once dirname(__FILE__) . '/ressources/class.rsync.inc'; $ini = new Bs_IniHandler(); $pid = getmypid(); if ($argv[1] == "--no-reboot") { $GLOBALS["NOREBOOT"] = true; } if (preg_match("#--verbose#", implode(" ", $argv))) { $GLOBALS["VERBOSE"] = true; } $_GET["RsyncStoragePath"] = trim(@file_get_contents("/etc/artica-postfix/settings/Daemons/RsyncStoragePath")); if ($_GET["RsyncStoragePath"] == null) { $_GET["RsyncStoragePath"] = "/var/spool/rsync"; } create_password_files(); echo "Search user that EnableBackupAccount is enabled\n"; $array = GetUserList(); if (!is_array($array)) { echo "No users...\n"; die; } while (list($organisation, $users) = each($array)) { echo "Parsing organization {$organisation}\n"; BuildConfig($organisation, $users); } function BuildConfig($organisation, $users) { @mkdir("/etc/rsync/secrets/{$organisation}", null, true); $rsyncd = new rsyncd_conf(); while (list($num, $user) = each($users)) { $uid = $user["uid"]; $RsyncBackupTargetPath = $user["RsyncBackupTargetPath"];
} } // array of required arguments for each action (when needed) $requiredArgs = array('get-rewarder-user-detail' => array('id'), 'get-rewarder-user' => array('id'), 'update-rewarder-user' => array('period_id'), 'update-rewarder-users' => array('period_id'), 'get-rewarder-list' => array('period_id'), 'populate-rewarder-list' => array('period_id'), 'update-rewarder-auditor' => array('id'), 'end-period' => array('reset', 'conversion_rate', 'signature'), 'reset_user_review' => array('user_id', 'review_id', 'period_id')); if (array_key_exists($_REQUEST['action'], $requiredArgs)) { foreach ($requiredArgs[$_REQUEST['action']] as $arg) { if (!isset($_REQUEST[$arg])) { echo json_encode(array('error' => 'args')); return; } } } $rewarder = new Rewarder($user->getId()); switch ($_REQUEST['action']) { case 'get-user-list': $userList = GetUserList($_SESSION['userid'], $_SESSION['nickname'], true); $currentUsers = $rewarder->getRewarderUserList($_REQUEST['period_id']); $ids = array(); foreach ($currentUsers as $user) { if ($user['id'] != null) { $ids[] = $user['id']; } } $users = array(); foreach ($userList as $user) { if (!in_array($user['id'], $ids)) { $users[] = array('id' => $user['id'], 'nickname' => $user['nickname']); } } echo json_encode($users); break;