public static function user()
 {
     $username = $_SESSION['LOGGED_IN_USER'];
     // obtain user_id and email through username
     $userArray = User::getUserInfo($username);
     return $userArray;
 }
Example #2
0
 public static function init()
 {
     global $disqusSecretKey, $disqusPublicKey, $theme, $fullAddr;
     $userInfo = User::getUserInfo();
     $userID = $userInfo['id'];
     $username = $userInfo['username'];
     $email = $userInfo['email'];
     $characterID = isset($userInfo['characterID']) ? $userInfo['characterID'] : null;
     $data = array('id' => $userID, 'username' => $username, 'email' => $email);
     if ($characterID) {
         $data['avatar'] = "https://image.eveonline.com/Character/{$characterID}_32.jpg";
         $data['url'] = "{$fullAddr}/character/{$characterID}/";
     }
     $message = base64_encode(json_encode($data));
     $timestamp = time();
     $hmac = hash_hmac('sha1', $message . ' ' . $timestamp, $disqusSecretKey);
     $js = "var disqus_config = function() {\n";
     $js .= "\t\tthis.page.remote_auth_s3 = '{$message} {$hmac} {$timestamp}';\n";
     $js .= "\t\tthis.page.api_key = '{$disqusPublicKey}';\n";
     $js .= "\n";
     $js .= "\t\tthis.sso = {\n";
     $js .= "\t\t\tname: 'zKillboard',\n";
     $js .= "\t\t\tbutton: '" . $fullAddr . "/img/disqus_button.png',\n";
     $js .= "\t\t\ticon: '" . $fullAddr . "/favicon.ico',\n";
     $js .= "\t\t\turl: '" . $fullAddr . "/dlogin/',\n";
     $js .= "\t\t\tlogout: '" . $fullAddr . "/logout',\n";
     $js .= "\t\t\twidth: '300',\n";
     $js .= "\t\t\theight: '245'\n";
     $js .= "\t\t};\n";
     $js .= '	};';
     return $js;
 }
Example #3
0
 public static function init()
 {
     global $disqusSecretKey, $disqusPublicKey;
     $userInfo = User::getUserInfo();
     $userID = $userInfo["id"];
     $username = $userInfo["username"];
     $email = $userInfo["email"];
     $data = array("id" => $userID, "username" => $username, "email" => $email);
     $message = base64_encode(json_encode($data));
     $timestamp = time();
     $hmac = hash_hmac("sha1", $message . ' ' . $timestamp, $disqusSecretKey);
     $js = "var disqus_config = function() {\n";
     $js .= "\t\tthis.page.remote_auth_s3 = '{$message} {$hmac} {$timestamp}';\n";
     $js .= "\t\tthis.page.api_key = '{$disqusPublicKey}';\n";
     $js .= "\n";
     $js .= "\t\tthis.sso = {\n";
     $js .= "\t\t\tname: 'zKillboard',\n";
     $js .= "\t\t\tbutton: 'https://zkillboard.com/img/disqus_button.png',\n";
     $js .= "\t\t\ticon: 'https://zkillboard.com/favicon.ico',\n";
     $js .= "\t\t\turl: 'https://zkillboard.com/dlogin/',\n";
     $js .= "\t\t\tlogout: 'https://zkillboard.com/logout',\n";
     $js .= "\t\t\twidth: '300',\n";
     $js .= "\t\t\theight: '232'\n";
     $js .= "\t\t};\n";
     $js .= "\t};";
     return $js;
 }
 public function getUser_directory()
 {
     $oUser = new User();
     # get the user information everyone has his own directory
     $user_info = $oUser->getUserInfo();
     $users_id = $user_info['id'];
     $users_firstname = $user_info['firstname'];
     $users_lastname = $user_info['lastname'];
     # the user directory
     $userdirectory = $users_id . "-" . $users_firstname . "-" . $users_lastname;
     # returns the user directory
     return $userdirectory;
 }
Example #5
0
 private function getUserData()
 {
     $users = array();
     // Open up the users folder and loop through all the .user files
     foreach (scandir('config/users') as $file) {
         if (File::fileExtension($file) == "user") {
             // Extract the user information from the file into a useful format
             $userInfo = User::getUserInfo(File::fileName($file));
             // Stuff the record into the result array
             $users[] = $userInfo;
         }
     }
     return $users;
 }
Example #6
0
 public function getGlobals()
 {
     $result = array();
     if (User::isLoggedIn()) {
         $u = User::getUserInfo();
         $config = UserConfig::getAll();
         foreach ($config as $key => $val) {
             $this->addGlobal($result, $key, $val);
         }
         $this->addGlobal($result, 'sessionusername', $u['username']);
         $this->addGlobal($result, 'sessionuserid', $u['id']);
         $this->addGlobal($result, 'sessionadmin', (bool) $u['admin']);
         $this->addGlobal($result, 'sessionmoderator', (bool) $u['moderator']);
     }
     global $mdb;
     $killsLastHour = new RedisTtlCounter('killsLastHour', 3600);
     $this->addGlobal($result, 'killsLastHour', $killsLastHour->count(), 0);
     return $result;
 }
 public function getGlobals()
 {
     global $showAds;
     $result = array();
     if (isset($_SESSION["loggedin"])) {
         $u = User::getUserInfo();
         $config = UserConfig::getAll();
         foreach ($config as $key => $val) {
             $this->addGlobal($result, $key, $val);
         }
         $this->addGlobal($result, "sessionusername", $u["username"]);
         $this->addGlobal($result, "sessionuserid", $u["id"]);
         $this->addGlobal($result, "sessionadmin", (bool) $u["admin"]);
         $this->addGlobal($result, "sessionmoderator", (bool) $u["moderator"]);
     }
     $this->addGlobal($result, "killsLastHour", Storage::retrieve("KillsLastHour", 0));
     $this->addGlobal($result, "showAds", $showAds);
     return $result;
 }
Example #8
0
 public function indexAction()
 {
     $user = new User();
     $param_arr = array('reg_time' => time(), 'remark' => "hello,rld.");
     $condition = array('uid' => 1058, 'sex' => 1);
     // $ret = $user->insert($param_arr);
     // $ret = $user->updateByUid($param_arr, 1058);
     // $ret = $user->update($param_arr, $condition);
     // $ret = $user->delete(array('uid'=>1051));
     // $ret = $user->getUserInfoByUid(1058);
     $condition = array('uid' => 1058);
     $ret = $user->getUserInfo($condition);
     var_dump($ret);
     echo "<pre>";
     // print_r($ret);
     die;
     $this->assign('userinfo', $ret);
     $this->display('index.tpl');
 }
Example #9
0
 private function validateForm()
 {
     // The errors array will hold all validation errors discovered
     $errors = array();
     // Get data
     $uname = $this->pageState['username'];
     $pw = $this->pageState['password'];
     $fname = $this->pageState['fullname'];
     $email = $this->pageState['email'];
     $home = $this->pageState['homefolder'];
     // Do validation --
     // Validate the username
     if (strlen(trim($uname)) > 0) {
         // Make sure there are no illegal characters
         if (!User::isValidUsername($uname)) {
             $errors[] = 'Your proposed username contains characters that are not allowed. Please use letters and numbers only.';
         }
         // Make sure the name doesn't already exist
         if (User::getUserInfo($uname)) {
             $errors[] = 'There is already a user with the username you propose. Please try using a different username.';
         }
         // Validate the other fields
         if (strlen(trim($pw)) == 0) {
             $errors[] = 'Password cannot be blank.';
         }
         if (strlen(trim($fname)) == 0) {
             $errors[] = 'Full Name cannot be blank.';
         }
         if (strlen(trim($email)) == 0) {
             $errors[] = 'Email cannot be blank. ';
         }
         if (strlen(trim($home)) == 0) {
             $errors[] = 'Home Folder cannot be blank. For root access, use "/"';
         }
     } else {
         // No username provided
         $errors[] = 'You must enter a username. Please use letters and numbers only.';
     }
     // Return the errors array
     return $errors;
 }
 private function validateForm()
 {
     // The errors array will hold all validation errors discovered
     $errors = array();
     // Do validation --
     // Validate the email
     $email = $this->pageState['email'];
     if (strlen($email) == 0) {
         // No email provided
         $errors[] = 'Your email address cannot be blank. Please enter you email address.';
     }
     // Validate the email password
     $username = $this->pageState['username'];
     $currentUserInfo = User::getUserInfo($username);
     // Compare the incoming email to the stored email for the user
     if ($currentUserInfo['email'] != $email) {
         // Email addresses don't match
         $errors[] = 'The email address you provided does not match the one on file. Please enter the correct email address.';
     }
     // Return the errors array
     return $errors;
 }
Example #11
0
 private function authenticateUser($username, $password)
 {
     // Look up the incoming user
     $currentUserInfo = User::getUserInfo($username);
     // Compare the incoming password to the stored password for the user
     if ($currentUserInfo['password'] == User::generatePassword($password)) {
         // The user has been authenticated, so start up a session and store user info there
         session_start();
         $_SESSION['auth'] = 'simple';
         $_SESSION['username'] = $username;
         $_SESSION['email'] = $currentUserInfo['email'];
         $_SESSION['password'] = $currentUserInfo['password'];
         $_SESSION['userPath'] = trim($currentUserInfo['userPath']);
         $_SESSION['usernameFriendly'] = trim($currentUserInfo['friendlyName']);
         $_SESSION['directoryMode'] = trim($currentUserInfo['directoryMode']);
         $_SESSION['editorMode'] = trim($currentUserInfo['editorMode']);
         // Set the current working directory
         $_SESSION['cwd'] = $_SESSION['userPath'];
         return true;
     } else {
         // Authentication failed
         return false;
     }
 }
Example #12
0
			<ul>
				<li>
					<label>Password</label>
					<input type="password" name="password" placeholder="Password" autocomplete="off" />
				</li>
			</ul>
		</fieldset>
		<input type="submit" name="adduser" value="Add New User" class="button settings-btn" />
	</form>
	</div>
<?php 
} elseif (isset($_GET['edit'])) {
    ?>
	
	<?php 
    $info = User::getUserInfo($_GET['edit']);
    ?>
	
	<div id="title-bar">
		
		<div id="title-bar-cont">
		
			<h1 class="left">Edit User</h1>
			
		</div>
	
	</div>
	
	<div id="container">
	
	<form action="dashboard.php?page=users" method="post">
Example #13
0
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/modules/User.class.php';
require_once dirname(dirname(dirname(__FILE__))) . '/modules/Company.class.php';
$userId = isset($_SESSION['user_id']) ? $_SESSION['user_id'] : 0;
if ($userId != 0) {
    $userObj = new User();
    $userInfo = $userObj->getUserInfo($userId, false);
    $companyObj = new Company();
    $listCompanies = array();
    if ($companyObj) {
        $listCompanies = $companyObj->getCompanyList(false);
    }
    if (count($userInfo) > 0) {
        ?>
		<form method="POST" class="form-horizontal" id="userInfoForm">
		<input type="hidden" id="baseName" name="baseName" value="<?php 
        echo __BASENAME__;
        ?>
" />
		<input type="hidden" name="userId" id="userId" value="<?php 
        echo $userInfo['id'];
        ?>
" />
		<input type="hidden" name="email" id="email" value="<?php 
        echo $userInfo['email'];
        ?>
" />
		<input type="hidden" name="firstName" id="firstName" value="<?php 
        echo $userInfo['firstName'];
        ?>
Example #14
0
 public function autoLogin()
 {
     if (isset($this->cookies['us']) || !isset($this->cookies['al'])) {
         return false;
     }
     $domain = 'tutuim.com';
     $alCookieValue = $this->cookies['al'];
     parse_str($this->abacaEncrypt($alCookieValue), $info);
     if (!isset($info['uid']) || !isset($info['cert']) || intval($info['uid']) <= 0) {
         setcookie('al', '', time() - 86400, '/', "");
         setcookie('al', '', time() - 86400, '/', $domain);
         return false;
     }
     $uid = intval($info['uid']);
     $passportdata = $this->getInfoWithUid($uid);
     $UserObj = new User();
     $userinfo = current($UserObj->getUserInfo($uid));
     if (!empty($passportdata['password'])) {
         if ($this->md5Together($uid, $passportdata['password']) != $info['cert']) {
             setcookie('al', '', time() - 86400, '/', "");
             setcookie('al', '', time() - 86400, '/', $domain);
             return false;
         }
         $this->setSsoCookie($passportdata, $userinfo);
     }
     return true;
 }
				$response = NULL;
				$drw_log = "Open data query";
				// Insert new or update existing
				$sql = "insert into redcap_data_quality_status (rule_id, non_rule, project_id, record, event_id, field_name, query_status, assigned_user_id)
				values (" . checkNull($rule_id) . ", " . checkNull($non_rule) . ", " . PROJECT_ID . ", '" . prep($result['record']) . "',
				{$result['event_id']}, " . checkNull($field) . ", " . checkNull($dr_status) . ", " . checkNull($user['ui_id']) . ")
				on duplicate key update query_status = " . checkNull($dr_status) . ", status_id = LAST_INSERT_ID(status_id)";
				if ($debug) {
					show_var($sql, 'INSERT STATUS', 'red');
				}
				if (true) {
				//if (db_query($sql)) {
					// Get cleaner_id
					$status_id = db_insert_id();
					// Get current user's ui_id
					$userInitiator = User::getUserInfo(USERID);
					// Add new row to data_resolution_log
					$sql = "insert into redcap_data_quality_resolutions (status_id, ts, user_id, response_requested,
					response, comment, current_query_status, upload_doc_id)
					values ($status_id, '" . NOW . "', " . checkNull($userInitiator['ui_id']) . ",
					" . checkNull($response_requested) . ", " . checkNull($response) . ",
					" . checkNull($rule_info['name']) . ", " . checkNull($dr_status) . ", " . checkNull($_POST['upload_doc_id']) . ")";
					if (!$debug) {
						if (db_query($sql)) {
							// Success, so return content via JSON to redisplay with new changes made
							$res_id = db_insert_id();
							## Logging
							// Set data values as json_encoded
							$logDataValues = json_encode(array('res_id' => $res_id, 'record' => $result['record'], 'event_id' => $result['event_id'],
								'field' => $field, 'rule_id' => $rule_id));
							// Set event_id in query string for logging purposes only
         }
         $dotValidateUser = new Dot_Validate_User(array('who' => 'user', 'action' => 'update', 'values' => $values, 'userId' => $registry->session->user->id));
         if ($dotValidateUser->isValid()) {
             // no error - then update user
             $data = $dotValidateUser->getData();
             $data['id'] = $registry->session->user->id;
             $userModel->updateUser($data);
             $session->message['txt'] = $option->infoMessage->update;
             $session->message['type'] = 'info';
         } else {
             $data = $dotValidateUser->getData();
             $session->message['txt'] = $dotValidateUser->getError();
             $session->message['type'] = 'error';
         }
     }
     $data = $userModel->getUserInfo($registry->session->user->id);
     $userView->details('update', $data);
     break;
 case 'register':
     // display signup form and allow user to register
     $data = array();
     $error = array();
     if ($_SERVER['REQUEST_METHOD'] === "POST") {
         // POST values that will be validated
         $values = array('details' => array('firstName' => isset($_POST['firstName']) ? $_POST['firstName'] : '', 'lastName' => isset($_POST['lastName']) ? $_POST['lastName'] : ''), 'username' => array('username' => isset($_POST['username']) ? $_POST['username'] : ''), 'email' => array('email' => isset($_POST['email']) ? $_POST['email'] : ''), 'password' => array('password' => isset($_POST['password']) ? $_POST['password'] : '', 'password2' => isset($_POST['password2']) ? $_POST['password2'] : ''), 'captcha' => array('recaptcha_challenge_field' => isset($_POST['recaptcha_challenge_field']) ? $_POST['recaptcha_challenge_field'] : '', 'recaptcha_response_field' => isset($_POST['recaptcha_response_field']) ? $_POST['recaptcha_response_field'] : ''));
         $dotValidateUser = new Dot_Validate_User(array('who' => 'user', 'action' => 'add', 'values' => $values));
         if ($dotValidateUser->isValid()) {
             // no error - then add user
             $data = $dotValidateUser->getData();
             $userModel->addUser($data);
             $session->message['txt'] = $option->infoMessage->add;
function check_existing_user($ldap_user)
{
    if (User::getUserInfo($ldap_user['uid']) == false && !empty($ldap_user['mail'])) {
        global $allow_create_db_default;
        $sql = "\n\t\t\tinsert into redcap_user_information \n\t\t\t\t(username, user_email, user_firstname, user_lastname, user_creation, allow_create_db) \n\t\t\tvalues ('" . prep($ldap_user['uid']) . "', \n\t\t\t\t'" . prep($ldap_user['mail']) . "', \n\t\t\t\t'" . prep($ldap_user['sudisplaynamefirst']) . "', \n\t\t\t\t'" . prep($ldap_user['sudisplaynamelast']) . " (added via userrights)', \n\t\t\t\tNOW(), \n\t\t\t\t{$allow_create_db_default})";
        $q = db_query($sql);
        if ($q) {
            log_event($sql, "redcap_user_information", "MANAGE", $ldap_user['uid'], "username = '******'uid']}'", "Update user info");
        }
        return false;
    } else {
        return true;
    }
}
Example #18
0
 private function updateUser()
 {
     // Get data
     $uname = $this->pageState['_username'];
     $fname = $this->pageState['fullname'];
     $email = $this->pageState['email'];
     $home = $this->pageState['homefolder'];
     $dm = $this->pageState['foldermgr'];
     $em = $this->pageState['adveditor'];
     // If the user is an admin, make their home folder blank
     if ($home == '/') {
         $home = '';
     }
     try {
         // Process the incoming user data
         $userInfo = User::getUserInfo($uname);
         // Place the given data into the user's information
         $userInfo['friendlyName'] = $fname;
         $userInfo['email'] = $email;
         $userInfo['userPath'] = $home;
         $userInfo['directoryMode'] = strtolower($dm) == 'foldermgr' ? 'ADVANCED' : 'BASIC';
         $userInfo['editorMode'] = strtolower($em) == 'adveditor' ? 'ADVANCED' : 'BASIC';
         // Save the information to the user's config file
         User::saveUserInfo($uname, $userInfo);
         // Head back to the user management page
         header('Location:/manage/userMgmt/showMessage/msg/userUpdated/user/' . $uname);
     } catch (Exception $exc) {
         $errors[] = 'There was a problem saving the user file for the user. Please check permissions on the config/users directory and the specific user configuration file (make sure both are writeable) and try again.';
         $this->view->errors = $errors;
         $this->get();
     }
 }
Example #19
0
     if ($code != "") {
         $arrayBean = array($_POST['area'], $_POST['road'], $_POST['address'], $_POST['name'], $_POST['user'], $_POST['code']);
         $bRet = Box::updateBox($arrayBean);
         if ($bRet == true) {
             $boxBean = Box::getAllBox();
             $smarty->assign("boxBean", $boxBean);
             $smarty->display('box.html');
         } else {
             echo "<script>alert('修改失败');history.back();</script>";
         }
     }
 } else {
     if (isset($_GET['active']) && $_GET['active'] == "loadInfo") {
         $area = Area::getAreaInfo();
         $road = Area::getRoadInfo();
         $user = User::getUserInfo();
         $rs['road'] = $road;
         $rs['user'] = $user;
         $rs['area'] = $area;
         echo json_encode($rs, JSON_UNESCAPED_UNICODE);
     } else {
         if (isset($_POST['submit']) && $_POST['id'] == "sigle") {
             $arrayBean = array($_POST['user'], $_POST['codeValue']);
             $bRet = Box::changeSigleRank($arrayBean);
             if ($bRet) {
                 $boxBean = Box::getBoxbyName($_POST['userName']);
                 $smarty->assign("boxBean", $boxBean);
                 $smarty->display('rank.html');
             }
         } else {
             if (isset($_POST['submit']) && $_POST['id'] == "more") {
Example #20
0
        if ($islogin['code'] != SUCC) {
            header('Location: index.php?m=user');
            exit;
        }
    }
}
$_REQUEST['uid'] = (int) $_SESSION['CLOUD_UID'];
if ($_REQUEST['uid']) {
    $uidLen = strlen($_REQUEST['uid']);
    for ($i = 0; $i < $uidLen; $i++) {
        if ($i % 2 == 0) {
            $uidDir .= sprintf("%02d", substr($_REQUEST['uid'], $i, 2)) . DS;
        }
    }
    $space = User::getUseSpace();
    $userInfo = User::getUserInfo($_REQUEST['uid']);
    $all = LIMIT + (int) $userInfo['capacity'];
    $space['percent'] = $space['space'] / ($all * 1024 * 1024 * 1024 * 1024) * 100;
    $space['all'] = $all;
    define('SPACE', json_encode($space));
}
define('UID_DIR', $uidDir);
define('UP_DIR', ROOT_PATH . 'files' . DS . $uidDir);
define('DATA_DIR', ROOT_PATH . DIR . DS . $uidDir);
$actionFile = ACTION_PATH . $m . '.class.php';
if (!file_exists($actionFile)) {
    echo Response::json(FAIL, array('no file'));
    exit;
}
require_once $actionFile;
if (!class_exists($m)) {
Example #21
0
<?php

$info = User::getUserInfo($_SESSION['username']);
?>

<div id="title-bar">
	
	<div id="title-bar-cont">
	
		<h1 class="left">Account Settings</h1>
		
	</div>

</div>

<div id="container">

<?php 
if (isset($_POST['save'])) {
    ?>
	<?php 
    User::saveUserInfo($_SESSION['username'], $_POST['name'], $_POST['email']);
    ?>
	<p class="message success">Account Settings Saved</p>
	
	<?php 
    if ($_POST['current'] != '' && $_POST['new'] != '' && $_POST['confirm'] != '') {
        if ($_POST['new'] != $_POST['confirm']) {
            echo '<p class="message notice">Sorry, your new passwords don\'t match!</p>';
        } else {
            User::changePassword($_SESSION['username'], $_POST['current'], $_POST['new']);
Example #22
0
$app->get('/friends/all', function () use($friends, $post) {
    $friend_list = $friends->getAllfriends($_SESSION['user_id']);
    foreach ($friend_list as $key => $value) {
        $friend_list[$key]['friendship_time_ago'] = $post->timeAgo($friend_list[$key]['friendship_created']);
    }
    echo json_encode($friend_list);
});
$app->get('/friends/allRequest', function () use($friends, $post) {
    $friend_list = $friends->getAllfriendsRequest($_SESSION['user_id']);
    foreach ($friend_list as $key => $value) {
        $friend_list[$key]['request_time_ago'] = $post->timeAgo($friend_list[$key]['request_created']);
    }
    echo json_encode($friend_list);
});
$app->get('/userInfo', function () use($user) {
    echo $user->getUserInfo($_SESSION['user_id']);
});
//builds your own profile page
$app->get('/profile', function () {
    global $user, $friends;
    $users = $user->buildProfile($_SESSION['user_id']);
    $users[0]['user_num_friends'] = $friends->getNumberOfFriends($_SESSION['user_id']);
    echo json_encode($users);
});
//builds someone else's profile page
$app->get('/profile/:id', function ($id) {
    global $user, $friends;
    $users = $user->buildProfile($id);
    $users[0]['user_num_friends'] = $friends->getNumberOfFriends($id);
    echo json_encode($users);
});
Example #23
0
    }
}
$data['entities'] = User::getUserTrackerData();
// Theme
$theme = UserConfig::get('theme', 'zkillboard');
$data['themesAvailable'] = [];
$data['currentTheme'] = $theme;
// Style
$data['stylesAvailable'] = Util::availableStyles();
$data['currentStyle'] = UserConfig::get('style');
$data['apiKeys'] = Api::getKeys($userID);
$data['apiChars'] = Api::getCharacters($userID);
$charKeys = Api::getCharacterKeys($userID);
$charKeys = Info::addInfo($charKeys);
$data['apiCharKeys'] = $charKeys;
$data['userInfo'] = User::getUserInfo();
$data['timeago'] = UserConfig::get('timeago');
$data['ddcombine'] = UserConfig::get('ddcombine');
$data['ddmonthyear'] = UserConfig::get('ddmonthyear');
$data['useSummaryAccordion'] = UserConfig::get('useSummaryAccordion', true);
$data['sessions'] = User::getSessions($userID);
$data['history'] = User::getPaymentHistory($userID);
$apiChars = Api::getCharacters($userID);
$domainChars = array();
if ($apiChars != null) {
    foreach ($apiChars as $apiChar) {
        $char = Info::getPilotDetails($apiChar['characterID'], null);
        $char['corpTicker'] = modifyTicker($mdb->findField('information', 'ticker', ['type' => 'corporationID', 'id' => (int) @$char['corporationID']]));
        $char['alliTicker'] = modifyTicker($mdb->findField('information', 'ticker', ['type' => 'corporationID', 'id' => (int) @$char['allianceID']]));
        $domainChars[] = $char;
    }
Example #24
0
<?php

$message = array();
$info = User::getUserInfo();
$ticket = Db::queryRow('SELECT * FROM zz_tickets WHERE id = :id', array(':id' => $id), 0);
if ($ticket == null or sizeof($ticket) == 0) {
    $message = array('status' => 'error', 'message' => 'Ticket does not exist.');
} elseif ($ticket['status'] == 0) {
    $message = array('status' => 'error', 'message' => 'Ticket has been closed, you cannot post, only view it');
} elseif ($ticket['userid'] != User::getUserID() && @$info['moderator'] == 0 && @$info['admin'] == 0) {
    $app->notFound();
}
if ($_POST) {
    $reply = Util::getPost('reply');
    if ($reply && $ticket['status'] != 0) {
        $name = $info['username'];
        $moderator = @$info['moderator'] == true;
        $check = Db::query('SELECT * FROM zz_tickets_replies WHERE reply = :reply AND userid = :userid AND belongsTo = :id', array(':reply' => $reply, ':userid' => User::getUserID(), ':id' => User::getUserID()), 0);
        if (!$check) {
            Db::execute('INSERT INTO zz_tickets_replies (userid, belongsTo, name, reply, moderator) VALUES (:userid, :belongsTo, :name, :reply, :moderator)', array(':userid' => User::getUserID(), ':belongsTo' => $id, ':name' => $name, ':reply' => $reply, ':moderator' => $moderator));
            global $baseAddr;
            if (!$moderator) {
                Log::irc("|g|Ticket response from {$name}|n|: https://{$baseAddr}/moderator/tickets/{$id}/");
            }
            $app->redirect("/tickets/view/{$id}/");
            exit;
        }
    } else {
        $message = array('status' => 'error', 'message' => 'No...');
    }
}
Example #25
0
">Resolve</a>
					<?php 
    }
    ?>
</th>
			   <td><?php 
    echo $ids[$i];
    ?>
</th>
			   <td><?php 
    echo $problems[$i];
    ?>
</th>
			   <td style="font-size:13px"><?php 
    echo User::getUserInfo($addedBy[$i]) . "<br>" . $dateAdded[$i];
    ?>
</th>
			   <td><?php 
    echo $solutions[$i];
    ?>
</th>
			   <td style="font-size:13px"><?php 
    echo User::getUserInfo($closedBy[$i]) . "<br>" . $dateClosed[$i];
    ?>
</th>
			</tr>
		<?php 
}
?>
		</tbody>
</body>
Example #26
0
} else {
    $position = '';
}
$page = "friends";
// Внимание! Дублирование кода. Блок кода приведенный ниже продублирован в leftUserBlock.php
$self = new Friends($user->id, $db);
$selfFriendsIds = $self->getConfirmedFriends();
$selfNotConfFriends = $self->getNotConfirmedFriends();
$selfFriendsRequests = $self->getFriendsRequests();
$friendsCount = count($selfFriendsIds);
$requestsCount = count($selfFriendsRequests);
if ($id != $user->id && !empty($id)) {
    try {
        $user1 = new User();
        $user1->db = $db;
        $user1->getUserInfo($id);
    } catch (DataException $e) {
        die(require "blocks/errorTemplate.php");
    }
} else {
    $user1 = $user;
}
$friend = new Friends($user1->id, $db);
if ($position == "requests" && empty($id)) {
    $friendsIds = $selfFriendsRequests;
} else {
    $friendsIds = $friend->getConfirmedFriends();
    $friendsCount = count($friendsIds);
}
for ($i = 0; $i < count($friendsIds); $i++) {
    $friend->getFriendInfo($friendsIds[$i]);
Example #27
0
 function processLoginResult($result)
 {
     $foo = User::getUserInfo($result);
     // get the userID, etc
     // @TODO: This may never hit
     if (empty($foo)) {
         // first time on The List
         User::makeUser($result);
         // make a User
         $foo = User::getUserInfo($result);
         // now get the userID
     }
     // Now let's make a session for the user
     $userid = $foo['id'];
     $session = User::getUserSession($userid);
     $session['email'] = $result;
     return $session;
 }
Example #28
-1
        }
    }
    $ddcombine = Util::getPost("ddcombine");
    if (isset($ddcombine)) {
        UserConfig::set("ddcombine", $ddcombine);
    }
    $ddmonthyear = Util::getPost("ddmonthYear");
    if (isset($ddmonthyear)) {
        UserConfig::set("ddmonthyear", $ddmonthyear);
    }
    $useSummaryAccordion = Util::getPost("useSummaryAccordion");
    if (isset($useSummaryAccordion)) {
        UserConfig::set("useSummaryAccordion", $useSummaryAccordion);
    }
}
$data["entities"] = Account::getUserTrackerData();
$data["themes"] = Util::bootstrapThemes();
$data["viewthemes"] = Util::themesAvailable();
$data["apiKeys"] = Api::getKeys($userID);
$data["apiChars"] = Api::getCharacters($userID);
$charKeys = Api::getCharacterKeys($userID);
$charKeys = Info::addInfo($charKeys);
$data["apiCharKeys"] = $charKeys;
$data["userInfo"] = User::getUserInfo();
$data["currentTheme"] = UserConfig::get("theme", "default");
$data["timeago"] = UserConfig::get("timeago");
$data["ddcombine"] = UserConfig::get("ddcombine");
$data["ddmonthyear"] = UserConfig::get("ddmonthyear");
$data["useSummaryAccordion"] = UserConfig::get("useSummaryAccordion");
$data["sessions"] = User::getSessions($userID);
$app->render("account.html", array("data" => $data, "message" => $error, "key" => $key, "reqid" => $reqid));