本文整理匯總了PHP中zotop::user方法的典型用法代碼示例。如果您正苦於以下問題:PHP zotop::user方法的具體用法?PHP zotop::user怎麽用?PHP zotop::user使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類zotop
的用法示例。
在下文中一共展示了zotop::user方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
public function __construct()
{
if (!zotop::user()) {
zotop::redirect('zotop/login');
}
$this->__init();
}
示例2: __construct
public function __construct()
{
if (!is_object($this->_db)) {
$this->_db = zotop::db();
}
$this->_user = zotop::user();
}
示例3: onDefault
public function onDefault()
{
$site = array();
$site['name'] = zotop::config('zotop.site.name');
$site['totalsize'] = zotop::config('zotop.ftp.size');
$site['totalsize'] = (int) $site['totalsize'] == 0 ? '--' : format::byte($site['totalsize']);
$database = array();
$database['size'] = zotop::db()->size();
$database['size'] = format::byte($database['size']);
$page['title'] = '控製中心';
$page['css'][] = url::module() . '/admin/css/main.css';
zotop::add('zotop.main.main', array(&$this, 'notepad'));
zotop::add('zotop.main.main', array(&$this, 'mylog'));
page::header($page);
page::top();
page::navbar($this->navbar(), 'main');
page::add('');
page::add('<div id="user" class="clearfix">');
page::add(' <div id="userface"><span class="image">' . html::image(zotop::user('image')) . '</span></div>');
page::add(' <div id="userinfo">');
page::add(' <h2 id="welcome">歡迎您,' . zotop::user('name') . ' <span id="sign">' . zotop::user('sign') . '</span></h2>');
page::add(' <div id="login">登錄時間:' . time::format(zotop::user('logintime')) . ' 登錄次數:' . zotop::user('loginnum') . ' 登錄IP:' . zotop::user('loginip') . '</div>');
//加載hook
zotop::run('zotop.main.action');
page::add('');
page::add('</div>');
page::add('<div class="grid-m-s">');
page::add('<div class="col-main">');
page::add('<div class="col-main-inner">');
zotop::run('zotop.main.main');
page::add('</div>');
page::add('</div>');
page::add('<div class="col-sub">');
zotop::run('zotop.main.sub');
block::header(array('title' => '網站信息', 'action' => '<a class="more" href="' . zotop::url('zotop/info/site') . '">詳細</a>'));
echo '<table class="table">';
echo '<tr><td class="w80">網站名稱:</td><td>' . $site['name'] . '</td></tr>';
echo '<tr><td class="w80">空間占用:</td><td>' . $site['totalsize'] . '</td></tr>';
echo '<tr><td class="w80">已上傳文件:</td><td></td></tr>';
echo '<tr><td class="w80">數據庫大小:</td><td>' . $database['size'] . '</td></tr>';
echo '</table>';
block::footer();
block::header(array('title' => '係統信息', 'action' => '<a class="more" href="' . zotop::url('zotop/main/system') . '">詳細</a>'));
echo '<table class="table">';
echo '<tr><td class="w80">程序版本:</td><td>' . zotop::config('zotop.version') . '</td></tr>';
echo '<tr><td class="w80">程序設計:</td><td>' . zotop::config('zotop.author') . '</td></tr>';
echo '<tr><td class="w80">程序開發:</td><td>' . zotop::config('zotop.authors') . '</td></tr>';
echo '<tr><td class="w80">官方網站:</td><td><a href="' . zotop::config('zotop.homepage') . '" target="_blank">' . zotop::config('zotop.homepage') . '</a></td></tr>';
echo '<tr><td class="w80">安裝時間:</td><td>' . zotop::config('zotop.install') . '</td></tr>';
echo '</table>';
block::footer();
page::add('</div>');
page::add('</div>');
page::bottom('<span class="zotop-tip">上次登錄時間:' . time::format(zotop::user('logintime')) . '</span>');
page::footer();
}
示例4: changeInfoAction
public function changeInfoAction()
{
$user = zotop::model('zotop.user');
$user->id = (int) zotop::user('id');
if (form::isPostBack()) {
$post = form::post();
$update = $user->update($post, $user->id);
if ($update) {
msg::success('資料設置成功,正在刷新頁麵,請稍後……', url::current());
}
msg::error();
}
$data = $user->read();
$page = new page();
$page->title = '修改我的基本信息';
$page->set('navbar', $this->navbar());
$page->set('data', $data);
$page->display();
}
示例5: actionInfo
public function actionInfo()
{
$user = zotop::model('system.user');
$user->id = (int) zotop::user('id');
if (form::isPostBack()) {
$post = form::post();
$update = $user->update($post, $user->id);
if ($update) {
msg::success('資料設置成功,正在刷新頁麵,請稍後……', url::location());
}
msg::error();
}
$data = $user->read();
$page = new page();
$page->title = zotop::t('個人中心');
$page->set('navbar', $this->navbar());
$page->set('globalid', $user->globalid());
$page->set('data', $data);
$page->display();
}
示例6: onDefault
public function onDefault()
{
$header['title'] = '控製中心';
$header['js'] = url::module() . '/admin/js/index.js';
$header['body']['class'] = 'frame';
page::header($header);
$html[] = '';
$html[] = '<script type="text/javascript">';
$html[] = ' zotop.url.frame.side="' . zotop::url('zotop/side') . '"';
$html[] = ' zotop.url.frame.main="' . zotop::url('zotop/main') . '"';
$html[] = ' zotop.url.msg.unread="' . zotop::url('zotop/msg/unread') . '"';
$html[] = '</script>';
$html[] = ' <div id="header">';
$html[] = ' <div id="top">';
$html[] = ' <div id="logo"><a href="' . zotop::url('zotop/main') . '" target="mainIframe" onfocus="this.blur();" title="首頁"></a></div>';
$html[] = ' <div id="action">';
$html[] = ' <div id="topbar">';
$html[] = ' <a href="javascript:notepad()">記事本</a><b>|</b>';
$html[] = ' <a href="' . zotop::url('zotop/setting') . '" target="mainIframe">係統設置</a><b>|</b>';
$html[] = ' <a href="' . zotop::url('zotop/about') . '" target="mainIframe" class="dialog {width:450,height:160}">關於</a>';
$html[] = ' </div>';
$html[] = ' <div id="user">';
$html[] = ' <span id="user-info"><b>' . zotop::user('username') . '</b>(administrator)</span>';
$html[] = ' <span id="user-action">';
$html[] = ' <span id="msg"><a href="' . zotop::url('zotop/msg') . '" target="mainIframe">短消息</a><span id="msg-unread"><a href="' . zotop::url('zotop/msg/default/0') . '" target="mainIframe"><span id="msg-unread-num">0</span>條未讀</a></span><b>|</b></span>';
$html[] = ' <a href="' . zotop::url('zotop/user/changepassword') . '" target="mainIframe">修改我的密碼</a><b>|</b>';
$html[] = ' <a href="' . zotop::url('zotop/login/logout') . '" id="logout" class="confirm {content:\'<h1>您確定要退出登錄?</h1>退出登陸後將默認將返回係統登錄頁麵\',yes:\'安全退出\'}">安全退出</a>';
$html[] = ' </span>';
$html[] = ' </div>';
$html[] = ' <div id="navbar">';
$html[] = ' <ul>';
$html[] = ' <li><a href="' . zotop::url('zotop/main') . '" target="mainIframe"><span>控製中心</span></a></li>';
$html[] = ' <li><a href="' . zotop::url('content') . '" target="mainIframe"><span>內容管理</span></a></li>';
$html[] = ' <li><a href="' . zotop::url('member') . '" target="mainIframe"><span>會員管理</span></a></li>';
$html[] = ' <li><a href="' . zotop::url('zotop/test') . '" target="mainIframe"><span>係統管理</span></a></li>';
$html[] = ' </ul>';
$html[] = ' </div>';
$html[] = ' </div>';
$html[] = ' </div>';
$html[] = ' <div id="position">';
$html[] = ' </div>';
$html[] = ' </div>';
$html[] = ' <div id="body">';
$html[] = ' <div id="side">';
$html[] = ' <div id="side-inner">';
$html[] = ' <div id="side-header">';
$html[] = ' <div class="side-block-header">';
$html[] = ' <div class="side-block-title">應用列表</div>';
$html[] = ' <div class="side-block-action"><a href="#">管理</a></div>';
$html[] = ' </div>';
$html[] = ' <div class="side-block-body">';
$html[] = ' <ul id="applications">';
$html[] = ' <li><a href="' . zotop::url('zotop/main') . '" target="mainIframe">控製中心</a></li>';
$html[] = ' <li><a href="' . zotop::url('zotop/test') . '" target="mainIframe">表單測試</a></li>';
$html[] = ' <li><a href="' . zotop::url('database') . '" target="mainIframe">數據庫管理</a></li>';
$html[] = ' <li><a href="' . zotop::url('zotop/io') . '" target="mainIframe">文件管理</a></li>';
$html[] = ' </ul>';
$html[] = ' </div>';
$html[] = ' <div class="side-block-footer">';
$html[] = ' </div>';
$html[] = ' </div>';
$html[] = ' <div id="side-body">';
$html[] = ' <div class="side-block-header">';
$html[] = ' <div class="side-block-title">內容管理</div>';
$html[] = ' <div class="side-block-action"><a href="javascript:zotop.frame.side().location.reload();">刷新</a> <a href="#" title="欄目管理">管理</a></div>';
$html[] = ' </div>';
$html[] = ' </div>';
$html[] = ' <div id="side-extra">';
$html[] = ' <div class="inner">';
$html[] = ' ' . html::iframe('sideIframe', 'about:blank', array('frameborder' => 'no', 'scrolling' => 'auto', 'width' => '100%', 'height' => '100%'));
$html[] = ' </div>';
$html[] = ' </div>';
$html[] = ' <div id="side-footer">';
$html[] = ' <div>Powered by <a href="' . zotop::config('zotop.homepage') . '" target="_blank">' . zotop::config('zotop.name') . ' ' . zotop::config('zotop.version') . '</a></div>';
$html[] = ' </div>';
$html[] = ' </div>';
$html[] = ' </div>';
$html[] = ' <div id="main">';
$html[] = ' ' . html::iframe('mainIframe', 'about:blank', array('frameborder' => 'no', 'scrolling' => 'auto', 'width' => '100%', 'height' => '100%'));
$html[] = ' </div>';
$html[] = ' </div>';
$html[] = ' <div id="footer">';
$html[] = ' </div>';
echo implode("\n", $html);
page::footer();
}
示例7: logout
/**
* 清除登陸信息
*
*/
public function logout()
{
//記錄用戶數據
zotop::user(null);
return true;
}
示例8: onLogout
public function onLogout()
{
zotop::user(null);
msg::success('登出成功', '登出成功,係統正在關閉中', 'reload', 2);
}
示例9: log
public static function log($type = '', $data = array())
{
if (empty($type)) {
return zotop::$logs;
}
if (is_array($type)) {
$log = $type;
}
if (is_string($data)) {
$log = array('type' => $type, 'content' => $data);
}
if (is_array($data)) {
$log = array('type' => $type, 'content' => $data);
}
if (!empty($log) && is_array($log)) {
$log = array('type' => $log['type'], 'title' => $log['title'], 'content' => $log['content'], 'description' => $log['description'], 'userid' => zotop::user('id'), 'url' => url::location(), 'createip' => ip::location(), 'createtime' => TIME);
zotop::$logs[] = $log;
}
return zotop::$logs;
}
示例10: __init
public function __init()
{
$this->user = zotop::user();
}
示例11: __construct
public function __construct()
{
if (zotop::user() == null) {
zotop::redirect('zotop/login');
}
}
示例12:
<?php
$this->header();
$this->top();
$this->navbar();
zotop::dump(zotop::user());
$this->bottom();
$this->footer();
示例13: user
/**
* 獲取當前的user cookie 數據
*
* @param string $key 字段名稱,如:id,username
* @return mixed
*/
public function user($key = '')
{
static $user = array();
if (empty($user)) {
$user = zotop::user();
}
if (empty($key)) {
return $user;
}
return $user[$key];
}
示例14: onChangeInfo
public function onChangeInfo()
{
$user = zotop::model('zotop.user');
$user->id = (int) zotop::user('id');
if (form::isPostBack()) {
$post = form::post();
$update = $user->update($post, $user->id);
if ($update) {
msg::success('保存成功', '資料設置成功,正在刷新頁麵,請稍後……', 'reload');
}
}
$data = $user->read();
$data['updatetime'] = TIME;
$page['title'] = '修改我的資料';
page::header($page);
page::top();
page::navbar($this->navbar());
form::header();
block::header('賬戶信息');
form::field(array('type' => 'label', 'label' => zotop::t('賬戶名稱'), 'name' => 'username', 'value' => $data['username'], 'valid' => '', 'description' => zotop::t('')));
form::field(array('type' => 'text', 'label' => zotop::t('安全問題'), 'name' => 'question', 'value' => $data['question'], 'valid' => '', 'description' => zotop::t('')));
form::field(array('type' => 'text', 'label' => zotop::t('安全答案'), 'name' => 'answer', 'value' => $data['answer'], 'valid' => '', 'description' => zotop::t('')));
block::footer();
block::header('個人信息');
form::field(array('type' => 'text', 'label' => zotop::t('真實姓名'), 'name' => 'name', 'value' => $data['name'], 'valid' => 'required:true', 'description' => zotop::t('')));
form::field(array('type' => 'radio', 'options' => array('男' => '男', '女' => '女'), 'label' => zotop::t('性別'), 'name' => 'gender', 'value' => $data['gender'], 'valid' => '', 'description' => zotop::t('')));
form::field(array('type' => 'image', 'label' => zotop::t('頭像'), 'name' => 'image', 'value' => $data['image'], 'valid' => '', 'description' => zotop::t('')));
form::field(array('type' => 'text', 'label' => zotop::t('電子郵件'), 'name' => 'email', 'value' => $data['email'], 'valid' => 'required:true,email:true', 'description' => zotop::t('')));
form::field(array('type' => 'textarea', 'label' => zotop::t('個人簽名'), 'name' => 'sign', 'value' => $data['sign'], 'valid' => '', 'description' => zotop::t('')));
form::field(array('type' => 'hidden', 'label' => zotop::t('更新時間'), 'name' => 'updatetime', 'value' => $data['updatetime'], 'valid' => '', 'description' => zotop::t('')));
block::footer();
form::buttons(array('type' => 'submit'), array('type' => 'back'));
form::footer();
page::bottom();
page::footer();
}