本文整理匯總了PHP中UserUtil::isExists方法的典型用法代碼示例。如果您正苦於以下問題:PHP UserUtil::isExists方法的具體用法?PHP UserUtil::isExists怎麽用?PHP UserUtil::isExists使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類UserUtil
的用法示例。
在下文中一共展示了UserUtil::isExists方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: run
/**
* 顯示用戶發送短信的界麵
*/
public function run()
{
$id = $this->getParameterFromGET('id');
if (!$id) {
$this->AlertAndBack(SSE_USER_ID_IS_EMPTY);
return;
}
//驗證用戶是否存在
if (!UserUtil::isExists($this->db, $id)) {
$this->AlertAndBack(SSE_USER_IS_NOT_EXISTS);
return;
}
//查看用戶是否公開有郵件。
//如果沒有,則不能向這個用戶發送郵件
$sql = 'select public_user_email from base_user_info where id=?';
$sth = $this->db->Prepare($sql);
$res = $this->db->Execute($sth, array($id));
$rows = $res->FetchRow();
if (!$rows['public_user_email']) {
$this->AlertAndBack(SSE_USER_EMAIL_IS_NOT_PUBLIC);
return;
}
$smarty = $this->getSmarty();
$fck = new FCKeditor("content");
$fck->BasePath = FCKEDITOR_BASEPATH;
$fck->ToolbarSet = 'Basic';
$fck->Height = '400';
$fck->Width = '98%';
$smarty->assign('fck', $fck);
$smarty->assign('id', $id);
$smarty->assign('backurl', $this->getParameter('backurl'));
$smarty->display('showsendemail.tmpl');
}
示例2: run
/**
* 顯示用戶發送短信的界麵
*/
public function run()
{
$id = $this->getParameterFromPOST('id');
if (!$id) {
$this->AlertAndBack(SSE_USER_ID_IS_EMPTY);
return;
}
//驗證用戶是否存在
if (!UserUtil::isExists($this->db, $id)) {
$this->AlertAndBack(SSE_USER_IS_NOT_EXISTS);
return;
}
//查看用戶是否公開有郵件。
//如果沒有,則不能向這個用戶發送郵件
$sql = 'select public_user_email from base_user_info where id=?';
$sth = $this->db->Prepare($sql);
$res = $this->db->Execute($sth, array($id));
$rows = $res->FetchRow();
if (!$rows['public_user_email']) {
$this->AlertAndBack(SSE_USER_EMAIL_IS_NOT_PUBLIC);
return;
}
//標題
$title = $this->getParameterFromPOST('title');
if (!$title) {
$title = SSE_NO_TITLE;
}
$content = $this->getParameterFromPOST('content');
//查詢郵件
$sql = 'select user_email from base_user_info where user_name=?';
$sth = $this->db->prepare($sql);
$res = $this->db->Execute($sth, array($_SESSION['user']['name']));
$rows = $res->FetchRow();
$from_address = $rows['user_email'];
$sql = 'select user_email from base_user_info where id=?';
$sth = $this->db->prepare($sql);
$res = $this->db->Execute($sth, $id);
$rows = $res->FetchRow();
$to_address = $rows['user_email'];
$headers = "To:" . $to_address . "\r\n";
$headers .= "From:" . $from_address . "\r\n";
mail($to_address, $title, $content, $headers);
$back_url = $this->getParameterFromPOST('backurl');
if ($back_url) {
$back_url = base64_decode($back_url);
$this->TipsAndForward(SE_SEND_EMAIL_SUCCESS, $back_url);
} else {
$this->TipsAndForward(SE_SEND_EMAIL_SUCCESS, 'index.php?module=user');
}
}
示例3: run
/**
* 查看用戶的個人信息
* @param: NULL
* @return: NULL
* @access: public
*/
public function run()
{
//取得用戶的id
$user_id = $this->getParameterFromGET('id');
if (!$user_id && $user_id != 0) {
$this->AlertAndBack(VU_USER_ID_IS_EMPTY);
return;
}
if ($user_id == 0) {
$this->AlertAndBack(VU_USER_IS_SYSTEM);
return;
}
if (!UserUtil::isExists($this->db, $user_id)) {
$this->AlertAndBack(VU_USER_IS_NOT_EXISTS);
return;
}
$smarty = $this->getSmarty();
//back url
$back_url = 'index.php?module=user&action=view&id=' . $user_id;
$back_url = base64_encode($back_url);
$smarty->assign('backurl', $back_url);
//assign user id
$smarty->assign('user_id', $user_id);
//用戶名
$user_name = UserUtil::getUserNameById($this->db, $user_id);
$smarty->assign('view_user_name', $user_name);
//用戶所在的組
$sql = 'select b.group_name from base_user_info as a join sys_group as b on ' . ' a.group_dep = b.id where a.id=?';
$sth = $this->db->Prepare($sql);
$res = $this->db->Execute($sth, array($user_id));
$rows = $res->FetchRow();
$smarty->assign('user_roles', $rows['group_name']);
//判斷用戶是否在線
$sql = 'select count(*) as num from online_user where user_name =? ';
$sth = $this->db->Prepare($sql);
$res = $this->db->Execute($sth, array($user_name));
$rows = $res->FetchRow();
if ($rows['num']) {
$smarty->assign('user_is_online', 1);
} else {
$smarty->assign('user_is_online', 0);
}
//求用戶的頭像
$user_header = UserUtil::getUserHeader($this->db, $user_id);
$smarty->assign('head_url', $user_header);
$sql = 'select user_gender,user_birthday, public_birthday, user_email, public_user_email, ' . 'user_website, public_website, register_date, user_icq, public_user_icq, user_AIM, ' . 'public_user_AIM, user_msn, public_user_msn, user_yahoo, public_user_yahoo,user_skype, ' . ' public_user_skype, user_qq, public_user_qq, user_hometown, user_favor, user_sign ' . ' from base_user_info where id=?';
$sth = $this->db->Prepare($sql);
$res = $this->db->Execute($sth, array($user_id));
$rows = $res->FetchRow();
//性別
$smarty->assign('user_sex', $rows['user_gender']);
//生日
if ($rows['public_birthday']) {
$smarty->assign('user_birthday', $rows['user_birthday']);
} else {
$smarty->assign('user_birthday', VU_NOT_PUBLIC);
}
//電子郵件
if ($rows['public_user_email']) {
$smarty->assign('user_email', $rows['user_email']);
} else {
$smarty->assign('user_email', VU_NOT_PUBLIC);
}
//個人網站
if ($rows['public_website']) {
$smarty->assign('user_website', $rows['user_website']);
} else {
$smarty->assign('user_website', VU_NOT_PUBLIC);
}
//注冊日期
$smarty->assign('user_register_date', $rows['register_date']);
//ICQ
if ($rows['public_user_icq']) {
$smarty->assign('user_icq', $rows['user_icq']);
} else {
$smarty->assign('user_icq', VU_NOT_PUBLIC);
}
//AIM
if ($rows['public_user_AIM']) {
$smarty->assign('user_aim', $rows['user_AIM']);
} else {
$smarty->assign('user_aim', VU_NOT_PUBLIC);
}
//MSN
if ($rows['public_user_msn']) {
$smarty->assign('user_msn', $rows['user_msn']);
} else {
$smarty->assign('user_msn', VU_NOT_PUBLIC);
}
//Yahoo
if ($rows['public_user_yahoo']) {
$smarty->assign('user_yahoo', $rows['user_yahoo']);
} else {
$smarty->assign('user_yahoo', VU_NOT_PUBLIC);
//.........這裏部分代碼省略.........