本文整理汇总了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'));
}
}