本文整理匯總了PHP中zotop::redirect方法的典型用法代碼示例。如果您正苦於以下問題:PHP zotop::redirect方法的具體用法?PHP zotop::redirect怎麽用?PHP zotop::redirect使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類zotop
的用法示例。
在下文中一共展示了zotop::redirect方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
public function __construct()
{
if (!zotop::user()) {
zotop::redirect('zotop/login');
}
$this->__init();
}
示例2: onDefault
public function onDefault()
{
if (form::isPostBack()) {
$post = array();
$post['username'] = request::post('username');
$post['password'] = request::post('password');
$post['logintime'] = time();
$user = zotop::model('zotop.user');
$data = $user->read($post['username'], 'username');
//zotop::dump($data);
if ($data == false) {
msg::error('登陸失敗', zotop::t('賬戶名稱`{$username}`不存在,請檢查!', array('username' => $post['username'])));
}
zotop::user($data);
msg::success('登陸成功', '登陸成功,係統正在加載中', 'reload', 2);
}
if (zotop::user() != null) {
zotop::redirect('zotop/index');
}
$header['title'] = '用戶登錄';
$header['js'] = url::module() . '/admin/js/login.js';
$header['body']['class'] = "login";
page::header($header);
block::header(array('id' => 'LoginWindow', 'title' => '用戶登錄'));
form::header(array('title' => '', 'description' => '請輸入用戶名和密碼', 'class' => 'small'));
form::field(array('type' => 'text', 'label' => zotop::t('帳 戶(U)'), 'name' => 'username', 'value' => zotop::user('username'), 'valid' => 'required:true'));
form::field(array('type' => 'password', 'label' => zotop::t('密 碼(P)'), 'name' => 'password', 'value' => ''));
form::buttons(array('type' => 'submit', 'value' => '登 陸'), array('type' => 'button', 'name' => 'options', 'value' => '選 項'));
form::footer();
block::footer();
page::footer();
}
示例3: onDefault
public function onDefault()
{
$db = zotop::db();
if ($db->connect()) {
zotop::redirect('database/table');
}
msg::error('連接數據庫失敗', '請檢查數據庫配置是否正確');
}
示例4: actionIndex
public function actionIndex()
{
$db = zotop::db();
if ($db->connect()) {
zotop::redirect(zotop::url('database/table'));
}
msg::error('連接數據庫失敗,請檢查數據庫配置是否正確');
}
示例5: actionImage
public function actionImage($globalid = '', $field = '', $image = '')
{
if (empty($image)) {
zotop::redirect('zotop/upload/imageFromLocal', array('globalid' => $globalid, 'field' => $field, 'image' => ''));
} else {
zotop::redirect('zotop/upload/imagePreview', array('globalid' => $globalid, 'field' => $field, 'image' => url::encode($image)));
}
}
示例6: actionPreview
public function actionPreview($id)
{
$content = zotop::model('content.content');
$content->read($id);
if ($content->link) {
zotop::redirect($content->url);
} else {
zotop::redirect(zotop::url('site://content/detail/' . $id));
}
}
示例7: actionPreview
public function actionPreview($globalid, $field, $image)
{
if (!file_exists(ZOTOP_PATH_ROOT . DS . $image)) {
zotop::redirect('zotop/image/upload', array('globalid' => $globalid, 'field' => $field, 'image' => url::encode($image)));
}
$file = zotop::model('zotop.image');
if ($file->isExist('path', $image)) {
$image = $file->read(array('path', '=', $image));
} else {
$image = array('path' => $image);
}
$page = new dialog();
$page->set('title', '圖片預覽');
$page->set('navbar', $this->navbar($globalid, $field, $image['path']));
$page->set('image', $image);
$page->display();
}
示例8: actionIndex
public function actionIndex()
{
$user = zotop::model('zotop.user');
if (form::isPostBack()) {
$post = array();
$post['username'] = request::post('username');
$post['password'] = request::post('password');
$post['logintime'] = time();
zotop::cookie('admin.username', $post['username'], 3600);
if (empty($post['username'])) {
msg::error(zotop::t('登陸失敗,請輸入登陸賬戶名稱'));
}
if (empty($post['password'])) {
msg::error(zotop::t('登陸失敗,請輸入登陸賬戶密碼'));
}
if (!$user->isValidUserName($post['username'])) {
msg::error(zotop::t('登陸失敗,請輸入有效的賬戶名稱'));
}
if (!$user->isValidPassword($post['password'])) {
msg::error(zotop::t('登陸失敗,請輸入有效的賬戶密碼'));
}
//讀取用戶
$data = $user->read(array('username', '=', $post['username']));
//驗證
if ($data == false) {
msg::error(zotop::t('賬戶名稱`{$username}`不存在,請檢查是否輸入有誤!', array('username' => $post['username'])));
}
if ($user->password($post['password']) != $data['password']) {
msg::error(zotop::t('賬戶密碼`{$password}`錯誤,請檢查是否輸入有誤!', array('password' => $post['password'])));
}
//用戶登入
$user->login();
//跳轉
msg::success('登陸成功,係統正在加載中', zotop::url('zotop/index'), 2);
}
if (!empty($this->user)) {
zotop::redirect('zotop/index');
}
$page = new page();
$page->set('title', zotop::t('係統管理登陸'));
$page->set('body', array('class' => 'login'));
$page->display('login');
}
示例9: actionLicense
public function actionLicense($path)
{
$module = zotop::model('zotop.module');
$modules = $module->getUnInstalled();
if (empty($path) || !dir::exists($path)) {
msg::error(array('content' => zotop::t('模塊不存在,請確認是否已經上傳該模塊?'), 'description' => zotop::t("路徑:{$path}")));
}
$licenseFile = $path . DS . 'license.txt';
if (!file::exists($licenseFile)) {
zotop::redirect('zotop/module/install', array('path' => url::encode($path)));
exit;
}
$license = file::read($licenseFile);
$page = new dialog();
$page->set('title', '許可協議');
$page->set('license', html::decode($license));
$page->set('next', zotop::url('zotop/module/install', array('path' => url::encode($path))));
$page->display();
}
示例10: licenseAction
public function licenseAction($id)
{
$module = zotop::model('zotop.module');
$modules = $module->getUnInstalled();
if (empty($id) || !isset($modules[$id])) {
msg::error(zotop::t('ID為<b>{$id}</b>的模塊不存在,請確認是否已經上傳該模塊?'));
}
$licenseFile = $modules[$id]['path'] . DS . 'license.txt';
if (!file::exists($licenseFile)) {
zotop::redirect('zotop/module/install', array('id' => $id));
exit;
}
$license = file::read($licenseFile);
$page = new dialog();
$page->set('title', '許可協議');
$page->set('license', html::decode($license));
$page->set('next', zotop::url('zotop/module/install', array('id' => $id)));
$page->display();
}
示例11: __check
public function __check()
{
if (empty($this->user)) {
zotop::redirect('zotop/login');
}
}
示例12: __construct
public function __construct()
{
if (zotop::user() == null) {
zotop::redirect('zotop/login');
}
}
示例13: __check
public function __check()
{
if (empty($this->user)) {
zotop::redirect(zotop::url('system/login'));
}
}