本文整理汇总了PHP中UserClient类的典型用法代码示例。如果您正苦于以下问题:PHP UserClient类的具体用法?PHP UserClient怎么用?PHP UserClient使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了UserClient类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkPassword
public function checkPassword($request, $response)
{/*{{{*/
$err = '';
$password = $request->password;
if ($password == '')
{
$err = '对不起,您的密码输入有误。请输入正确的密码。';
}
$nowAction = $request->parentaction ? $request->parentaction : 'index';
$nowAction = $nowAction == 'showorderlist' ? $nowAction.'?type=5' : $nowAction;
if(empty($err))
{
$user = UserClient::getInstance()->checkPassword($this->_newSpace->user->name, $password, time()+1200);
if ($user->isNull())
{
$err = '对不起,您的密码输入有误。请输入正确的密码。';
}
else
{
$response->setRedirect($response->router->urlfor('adminpayment/'.$nowAction));
return true;
}
}
$response->setRedirect($response->router->urlfor("adminpayment/inputpassword?err=$err&parentaction=".$nowAction));
}/*}}}*/
示例2: doSuggestion
public function doSuggestion($request, $response)
{/*{{{*/
$suggestion = iconv("utf8", "gbk", $request->suggestion);
$contactInfo = iconv("utf8", "gbk", $request->contactInfo);
if ($suggestion == '' || $suggestion == '请填写您在使用中遇到的问题(目前暂时不提供疾病咨询服务)')
{
echo '{"res":"failure", "msg":"请填写您在使用中遇到的问题!"}';
return self::DIRECT_OUTPUT;
}
if ($contactInfo == '' || $contactInfo == '手机或邮箱')
{
echo '{"res":"failure", "msg":"请填写您的联系方式!"}';
return self::DIRECT_OUTPUT;
}
$from = $request->from;
$content = "来自 ".$from." 的用户(触屏版)发送了一条意见或建议, 内容如下:\n";
$content .= "----------------------------------------------------------------------------\n";
$content .= $suggestion."\n\n";
$content .= "联系方式: $contactInfo\n";
$content .= "----------------------------------------------------------------------------\n";
$content .= XDateTime::now()->toString();
$userId = 0;
$result = UserClient::getInstance()->addUserAdvice('意见建议', $content, $userId);
if ($result)
{
echo '{"res":"success"}';
}
else
{
echo '{"res":"failure", "msg":"对不起,信息提交失败!"}';
}
return self::DIRECT_OUTPUT;
}/*}}}*/
示例3: __construct
public function __construct($request, $response)
{
/*{{{*/
parent::__construct($request, $response);
$clients = array('auditorClient', 'threadCateClient', 'userClient', 'spaceClient', 'doctorClient', 'hospitalClient', 'hospitalFacultyClient', 'PatientClient', 'DoctorPatientPostClient', 'inspectClient');
foreach ($clients as $client) {
$this->{$client} = new ClientProxy($client);
}
$userId = UserClient::getInstance()->getCheckedSeed('id');
if ($userId) {
$this->curUser = DAL::get()->find('user', $userId);
} else {
$this->curUser = new NullEntity();
}
$response->curUser = $this->curUser;
$response->staticUrl = 'http://i1.hdfimg.com/in/case';
$response->leftWidth = '40%';
//$response->leftWidth = '43%';
$response->controller = $request->controller;
$response->action = $request->action;
$response->showContent = $request->showContent;
$this->user = $response->user;
$this->curInspector = $response->curInspector;
$this->auditor = $response->auditor;
if (false == $this->auditor instanceof Auditor) {
$auditor = $this->curInspector->getAuditorEntity4auditfront();
$this->auditor = $auditor;
}
$response->args = array();
$response->isAjax = $request->ajax_status;
}
示例4: __construct
public function __construct()
{
// echo "ta aqui.".UserClient::getTypeId();exit();
if (!UserClient::isAlive() || UserClient::getTypeId() != Config::ADMIN_USER_TYPE_ID && UserClient::getTypeId() != Config::DEVELOPER_USER_TYPE_ID) {
$urlTo = Navigation::getURI(Config::$URL_ROOT_APPLICATION);
Navigation::redirect("backend/login/to/" . implode("/", $urlTo));
}
}
示例5: before
public function before($context)
{
$userId = UserClient::getInstance()->getCheckedSeed('id');
$user = DAL::get()->mustFind('user', $userId);
$inspector = DAL::get()->find_actived('inspector', $user);
$hasClaimPaymentPower = $inspector->isInRenLingHuiKuanGroup();
DBC::requireTrue($hasClaimPaymentPower, '您没有认领汇款权限');
}
示例6: __construct
public function __construct($request, $response)
{
parent::__construct($request, $response);
$userId = UserClient::getInstance()->getCheckedSeed('id');
$this->curOperatorUser = DAL::get()->mustFind('user', $userId);
$response->curOperatorUser = $this->curOperatorUser;
$this->inspector = DAL::get()->find_actived('inspector', $this->curOperatorUser);
$response->inspector = $this->inspector;
}
示例7: insert
/**
* @return para poder inserir
*/
public function insert()
{
// echo "cocococo";exit();
if (UserClient::getTypeId() == Config::DEVELOPER_USER_TYPE_ID) {
return $this->createFormData();
} else {
Navigation::redirect("admin/");
}
}
示例8: __construct
public function __construct($request, $response)
{
parent::__construct($request, $response);
$userId = UserClient::getInstance()->getCheckedSeed('id');
if ($userId) {
$this->_newUser = DAL::get()->find('user', $userId);
} else {
$this->_newUser = new NullEntity();
}
}
示例9: before
public function before($context)
{
$userId = UserClient::getInstance()->getCheckedSeed('id');
$user = DAL::get()->find('user', $userId);
if($user->isNull())
{
header('Location: http://m.haodf.com/touch');
exit;
}
}
示例10: getZipedFiles
/**
* envie por post uma array de ids de files, só os ids
* file/get_ziped_files
*/
public function getZipedFiles()
{
if (!UserClient::getId() > 0) {
//nao tem permissao
Navigation::redirect("405");
exit;
}
$array_file_ids = DataHandler::getValueByArrayIndex($_POST, "file_id");
//Debug::print_r($_REQUEST);
$array_file_vo = array();
if (is_array($array_file_ids)) {
foreach ($array_file_ids as $id) {
$FileVO = new FileVO();
$Result = $FileVO->setId($id, TRUE);
if ($Result->success == TRUE) {
$array_file_vo[] = $FileVO;
}
}
} else {
//erro, não é uma array, verifica se pelo menos é 1 único id
$id = DataHandler::forceInt($array_file_ids);
if ($id > 0) {
//é um id único
$FileVO = new FileVO();
$Result = $FileVO->setId($id, TRUE);
if ($Result->success == TRUE) {
$array_file_vo[] = $FileVO;
}
} else {
//erro mesmo, esse dado é zoado, estoura excessão
throw new Exception("No ids sended", 404);
exit;
}
}
//a pasta zip precisa existir
DataHandler::createFolderIfNotExist("upload/zip/");
//verifica o nome do arquivo baseado nos ids enviados conforme regra inventada agora
$zip_name = "upload/zip/" . md5(implode("|", $array_file_ids));
DataHandler::createFolderIfNotExist($zip_name);
$zip_name = $zip_name . "/teto.zip";
if (!file_exists($zip_name)) {
//echo Debug::li($zip_name);exit();
$Zip = new ZipArchive();
$Zip->open($zip_name, ZipArchive::CREATE);
foreach ($array_file_vo as $FileVO) {
$url = $FileVO->getUrl();
$array = explode("/", $url);
$file = $array[count($array) - 1];
$Zip->addFile($url, $file);
}
$Zip->close();
}
header("Location: " . Config::getRootPath($zip_name));
exit;
}
示例11: ajaxSetRead
public function ajaxSetRead($request, $response)
{
$str = '';
if (UserClient::getInstance()->isLogin() && $request->msgid)
{
$data = array('UserId' => $this->user->id, 'MsgId' => $request->msgid);
StationLetterClient::getInstance()->setMsgRead($data['UserId'], $data['MsgId']);
$str = "²Ù×÷³É¹¦";
}
$response->callBack = $request->callback;
$response->msg = $str;
}
示例12: __construct
public function __construct($request, $response)
{
parent::__construct($request, $response);
$configs = BeanFinder::get('configs');
$response->imgUrl = $configs->imgUrl;
$userId = UserClient::getInstance()->getCheckedSeed('id');
if ($userId)
$this->_newUser = DAL::get()->find('user',$userId);
else
$this->_newUser = new NullEntity();
$response->newUser = $this->_newUser;
}
示例13: __construct
public function __construct($request, $response)
{
parent::__construct($request, $response);
$response->_debugger = new Debugger();
$response->_start = $response->_debugger->getTimeStamp();
$userId = UserClient::getInstance()->getCheckedSeed('id');
$this->user = DAL::get()->find('user', $userId);
$this->tester = DAL::get()->find_by_userid('tester', $userId);
$response->user = $this->user;
$response->tester = $this->tester;
$response->preMsg = $request->preMsg;
}
示例14: __construct
public function __construct($arrayRestFolder = NULL)
{
//verifica se o sujeito está logado e se é admin
if (!UserClient::isAlive()) {
Navigation::redirect("admin/login");
} else {
if (UserClient::getTypeId() != Config::ADMIN_USER_TYPE_ID && UserClient::getTypeId() != Config::DEVELOPER_USER_TYPE_ID) {
//o sujeito ou não está logado ou ele não é admin
Navigation::redirect("admin/login");
}
}
if ($arrayRestFolder != NULL) {
$this->arrayVariable = Navigation::getVariableArraySlug($arrayRestFolder);
$this->arrayRestFolder = $arrayRestFolder;
}
}
示例15: before
public function before($context)
{
$spaceUserName = WebUtil::getSpaceUserName($context->request);
$space = SpaceClient::getInstance()->getSpaceByUserName($spaceUserName);
$userId = UserClient::getInstance()->getCheckedSeed('id');
$user = DAL::get()->find('user', $userId);
if ($space->isNull()) {
header('Location: http://www.haodf.com');
exit;
}
if (empty($userId) || $space->user->id != $userId && false == $user->isAdmin()) {
$msg = rawurlencode('你没有权限操作!');
header('Location: ' . $space->getUrl() . 'index/showmessage?msg=' . $msg);
exit;
}
}