本文整理汇总了PHP中users::getCid方法的典型用法代码示例。如果您正苦于以下问题:PHP users::getCid方法的具体用法?PHP users::getCid怎么用?PHP users::getCid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类users
的用法示例。
在下文中一共展示了users::getCid方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getContactsInfo
/**
* Вернуть контактные данные фрилансера если есть доступ их смотреть
*
* @param type $login
* @param type $hash
* @return \xajaxResponse
*/
function getContactsInfo($login, $hash)
{
$objResponse = new xajaxResponse();
if ($hash === paramsHash(array($login))) {
$freelancer = new freelancer();
$freelancer->GetUser($login);
if ($freelancer->uid > 0 && !is_emp($freelancer->role) && is_view_contacts($freelancer->uid) && is_contacts_not_empty($freelancer)) {
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/template.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/country.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/city.php';
require_once ABS_PATH . '/classes/statistic/StatisticFactory.php';
require_once ABS_PATH . '/classes/users.php';
$html = Template::render($_SERVER['DOCUMENT_ROOT'] . '/user/contacts_info.php', array('user' => $freelancer));
$ga = StatisticFactory::getInstance('GA');
$ga->queue('event', array('uid' => isset($_SESSION['uid']) ? $_SESSION['uid'] : 0, 'cid' => users::getCid(), 'category' => 'Freelancer', 'action' => 'show_contacts', 'label' => "{'login': '{$freelancer->login}'}"));
$objResponse->assign('contacts_info_block', 'innerHTML', $html);
}
}
return $objResponse;
}
示例2: afterSuccessRegistation
/**
* Метод вызывается после успешной регистации
*/
protected function afterSuccessRegistation($newuser)
{
if (!$newuser || $newuser->uid <= 0) {
return false;
}
$_SESSION['reg_role'] = is_emp($newuser->role) ? 'customer' : 'freelancer';
//Отправить в очередь события регистрации для GA
require_once ABS_PATH . '/classes/statistic/StatisticFactory.php';
require_once ABS_PATH . '/classes/users.php';
$ga = StatisticFactory::getInstance('GA');
$ga->queue('event', array('uid' => $newuser->uid, 'cid' => users::getCid(), 'category' => $_SESSION['reg_role'], 'action' => 'registration_finished'));
return true;
}
示例3: sendStatistic
public function sendStatistic($project_kind_ident, $offers_count, $is_pro, $offer_id)
{
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/projects.php';
global $DB;
$params = array('cid' => users::getCid(), 'project_kind_ident' => $project_kind_ident, 'offer_count' => $offers_count, 'is_pro' => $is_pro, 'offer_id' => $offer_id);
$query = http_build_query($params);
$DB->query("SELECT pgq.insert_event('statistic', 'project_answer', ?)", $query);
}
示例4: array
if ($id == users::AUTH_STATUS_2FA) {
if (!empty($customRedirect)) {
$_SESSION['2fa_redirect'] = array('redirectUri' => $customRedirect);
}
//Редирект на 2ой атап авторизации
$back_url = '/auth/second/';
} elseif (!$back_url) {
$back_url = is_emp() ? '/' : '/projects/';
}
//Успешная авторизация
if ($id > 0) {
//Отправляем в очередь событие об успешной авторизации
if ($type = $opauthModel->getShortType()) {
require_once ABS_PATH . '/classes/statistic/StatisticFactory.php';
$ga = StatisticFactory::getInstance('GA');
$ga->queue('event', array('uid' => $id, 'cid' => users::getCid(), 'category' => is_emp() ? 'customer' : 'freelancer', 'action' => 'authorization_passed', 'label' => $type));
}
}
} else {
$_SESSION['opauth_error'] = 'Данный аккаунт социальной сети уже привязан к другому пользователю';
}
header("Location: {$back_url}");
exit;
} else {
if ($type == OpauthHelper::ACTION_REGISTER) {
$registrationData = OpauthHelper::getRegistrationData($response);
$postedRole = $emp_redirect ? registration::ROLE_EMPLOYER : __paramInit('int', null, 'role_db_id');
$postedEmail = __paramInit('string', null, 'email');
$postedLogin = __paramInit('string', null, 'login');
if ($postedRole && $postedEmail && $postedLogin) {
$registrationData['role'] = $postedRole;
示例5: isValid
/**
* Проверка авторизации и установка ошибки или URL для перехода
*
* @param type $data
* @return boolean
*/
public function isValid($data)
{
if ($valid = parent::isValid($data)) {
$data = $this->getValues();
$autologin = isset($data['autologin']) && $data['autologin'] == 1;
$pwd = users::hashPasswd($data['passwd']);
$uid = login($data['login'], $pwd, $autologin);
switch ($uid) {
case self::UID_FAIL:
$valid = false;
$this->getElement('login')->addError(self::FAIL_LOGIN_MSG);
break;
case self::UID_BANNED:
$_SESSION['rand'] = csrf_token();
$this->redirect_to = sprintf(self::REDIRECT_URL_BANNED, $data['login'], $_SESSION['rand']);
break;
case self::UID_INNACTIVE:
$this->redirect_to = self::REDIRECT_URL_INACTIVE;
break;
case self::UID_DENYIP:
$this->redirect_to = sprintf(self::REDIRECT_URL_DENYIP, $data['login']);
break;
case users::AUTH_STATUS_2FA:
$this->redirect_to = self::REDIRECT_URL_2FA;
break;
default:
//Успешная авторизация
if ($uid > 0) {
$default_location = is_emp() ? '/tu/' : '/projects/';
$ref_uri = isset($_SESSION['ref_uri']) ? urldecode($_SESSION['ref_uri']) : null;
$ref_uri = !$ref_uri ? $default_location : $ref_uri;
$location = HTTP_PFX . $_SERVER['HTTP_HOST'] . $ref_uri;
// #0012501
$location = preg_replace("/\\/router\\.php\\?pg=/", "", $location);
// #0011589
if (strpos($location, '/remind/') || strpos($location, 'inactive.php') || strpos($location, 'checkpass.php') || strpos($location, '/registration/') || strpos($location, 'fbd.php')) {
$location = $default_location;
}
session_write_close();
//Отправляем в очередь событие об успешной авторизации
require_once ABS_PATH . '/classes/statistic/StatisticFactory.php';
require_once ABS_PATH . '/classes/users.php';
$ga = StatisticFactory::getInstance('GA');
$ga->queue('event', array('uid' => $uid, 'cid' => users::getCid(), 'category' => is_emp() ? 'customer' : 'freelancer', 'action' => 'authorization_passed', 'label' => 'email'));
$this->redirect_to = $location;
}
}
}
return $valid;
}