Пример #1
0
 function try_login()
 {
     $this->user = $this->facebook->getUser();
     //defaultni vypis problemu s prihlasenim
     $l = new lang("layout");
     $msg = new msg();
     if ($this->user == null) {
         $msg->set_text($l->t("bad_fb_login"), "error");
         redirect($l->l("prihlaseni"));
     }
     //nyni mame udaje o uzivateli
     //pokusime se zjistit, zda-li j*z v databazi nekdo takovy je (fb_id)
     $sql = sql_query("select id, nick from users\n\t\t\t\t\t\t\t\t\t\t\t\t\twhere (fb_id = '" . $this->user . "')");
     $data = sql_fetch_object($sql);
     //j*z v databzi existuje
     if ($data->id) {
         $_SESSION['uid'] = $data->id;
         $_SESSION['me'] = new me($data->id);
         $_SESSION['me']->homepage_redirect();
     } else {
         $new_login = $this->create_login();
         if ($new_login) {
             $_SESSION['uid'] = $new_login[0];
             $_SESSION['me'] = new me($new_login[0]);
             //prvotni presun po registraci na nastaveni a doplneni udaju
             header("location: " . $l->l("osobni-udaje") . "?first=true");
             return true;
         }
     }
     $msg->set_text($l->t("bad_fb_login"), "error");
     redirect($l->l("prihlaseni"));
 }
Пример #2
0
 protected function module_register()
 {
     if ($this->module_is_logedin()) {
         header("Location:" . cls_general::create_url(array('plugin', 'users', 'action', 'profile')));
     } elseif ($this->settings['register'] == '0') {
         //new register was closed
         $msg = new msg();
         return $msg->msg('Warrning!', 'Register new user was closed by Administrator.', 'danger');
     }
     return $this->view_register();
 }
Пример #3
0
 public function onDefault()
 {
     if (form::isPostBack()) {
         msg::error('开发中', '数据保存开发中,请稍后……');
     }
     $header['title'] = '系统设置';
     page::header($header);
     page::top();
     page::navbar($this->navbar(), 'main');
     form::header();
     block::header('网站基本信息');
     form::field(array('type' => 'text', 'label' => zotop::t('网站名称'), 'name' => 'zotop.site.title', 'value' => zotop::config('zotop.site.title'), 'description' => zotop::t('网站名称,将显示在标题和导航中')));
     form::field(array('type' => 'text', 'label' => zotop::t('网站域名'), 'name' => 'zotop.site.domain', 'value' => zotop::config('zotop.site.domain'), 'description' => zotop::t('网站域名地址,不包含http://,如:www.zotop.com')));
     form::field(array('type' => 'text', 'label' => zotop::t('备案信息'), 'name' => 'zotop.site.icp', 'value' => zotop::config('zotop.site.icp'), 'description' => zotop::t('页面底部可以显示 ICP 备案信息,如果网站已备案,在此输入您的授权码,它将显示在页面底部,如果没有请留空')));
     form::field(array('type' => 'select', 'options' => array('0' => '不显示', '1' => '显示'), 'label' => zotop::t('授权信息'), 'name' => 'zotop.site.license', 'value' => zotop::config('zotop.site.license'), 'description' => zotop::t('页脚部位显示程序官方网站链接')));
     form::field(array('type' => 'textarea', 'label' => zotop::t('网站简介'), 'name' => 'zotop.site.about', 'value' => zotop::config('zotop.site.about')));
     block::footer();
     block::header('联系信息设置');
     form::field(array('type' => 'text', 'label' => zotop::t('公司名称'), 'name' => 'zotop.site.title', 'value' => '', 'description' => zotop::t('网站隶属的公司或者组织名称')));
     form::field(array('type' => 'textarea', 'label' => zotop::t('网站简介'), 'name' => 'zotop.site.about', 'value' => ''));
     block::footer();
     form::buttons(array('type' => 'submit'), array('type' => 'back'));
     form::footer();
     page::bottom();
     page::footer();
 }
Пример #4
0
 function try_login()
 {
     //defaultni vypis problemu s prihlasenim
     $l = new lang("layout");
     $msg = new msg();
     //pokud nam google vrati code, muzeme se autentifikovat a ziksat token
     $code = clear("code");
     if ($code) {
         $this->client->authenticate();
         $this->token = $this->client->getAccessToken();
     }
     /*
     				//kdybychom chteli na nejake jine strance zase s uctem u googlu pracovat
     				// musimve vytvorit to spojeni a pomoci se token ze session se autorizovat u googlu
     				//ale mi tady session token nulujeme, takze uz se dal pouzit neda
     						if ($_SESSION['token']) {
     						  $this->client->setAccessToken($_SESSION['token']);
     						}
     				//kdyz ho chceme ziskat
     							  $_SESSION['token'] = $this->client->getAccessToken();
     */
     if ($this->token) {
         $my_data = $this->plus->people->get('me');
         $gp_id = $my_data['id'];
         //nyni mame udaje o uzivateli
         //pokusime se zjistit, zda-li j*z v databazi nekdo takovy je (gp_id)
         $sql = sql_query("select id, nick from users\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twhere (gp_id = '" . $gp_id . "')");
         $data = sql_fetch_object($sql);
         //j*z v databazi existuje
         if ($data->id) {
             $_SESSION['uid'] = $data->id;
             $_SESSION['me'] = new me($data->id);
             $_SESSION['me']->homepage_redirect();
         } else {
             $new_login = $this->create_login($my_data);
             if ($new_login) {
                 $_SESSION['uid'] = $new_login[0];
                 $_SESSION['me'] = new me($new_login[0]);
                 //prvotni presun po registraci na nastaveni a doplneni udaju
                 header("location: " . $l->l("osobni-udaje") . "?first=true");
                 return true;
             }
         }
     }
     $msg->set_text($l->t("bad_gplus_login"), "error");
     redirect($l->l("prihlaseni"));
 }
Пример #5
0
 public function actionIndex()
 {
     $db = zotop::db();
     if ($db->connect()) {
         zotop::redirect(zotop::url('database/table'));
     }
     msg::error('连接数据库失败,请检查数据库配置是否正确');
 }
Пример #6
0
 public function onDefault()
 {
     $db = zotop::db();
     if ($db->connect()) {
         zotop::redirect('database/table');
     }
     msg::error('连接数据库失败', '请检查数据库配置是否正确');
 }
Пример #7
0
 public function actionDelete($id)
 {
     $file = zotop::model('zotop.file');
     $delete = $file->delete($id);
     if ($delete) {
         msg::success('删除成功', request::referer());
     }
 }
Пример #8
0
 public function sqlAction()
 {
     if (form::isPostBack()) {
         msg::error('该功能已经被禁用,请进入设置开启');
     }
     $page = new dialog();
     $page->title = '数据库管理:' . $database['database'] . ' @ ' . $database['hostname'] . '<i>></i> 执行sql语句';
     $page->display();
 }
Пример #9
0
 public static function alert($title, $content = '', $life = 0)
 {
     $msg = array();
     $msg['type'] = 'alert';
     $msg['title'] = empty($content) ? 'alert' : $title;
     $msg['content'] = empty($content) ? $title : $content;
     $msg['content'] = empty($content) ? $title : $content;
     $msg['life'] = $life;
     msg::show($msg);
 }
Пример #10
0
 public function actionDelete($id)
 {
     $category = zotop::model('blog.category');
     $category->id = $id;
     $category->delete();
     if (!$category->error()) {
         msg::success('删除成功', zotop::url('blog/category/index'));
     }
     msg::error($category->msg());
 }
Пример #11
0
 public function actionImageFromUrl($globalid, $field, $image)
 {
     if (form::isPostBack()) {
         msg::error('远程获取中……');
     }
     $page = new dialog();
     $page->set('title', '网络图片');
     $page->set('navbar', $this->navbar($globalid, $field, $image));
     $page->display();
 }
Пример #12
0
 /**
  * 显示成功消息
  *
  */
 public static function success($content = '', $url = '', $life = 2)
 {
     $msg = array('type' => 'success', 'title' => zotop::t('success'), 'content' => '', 'detail' => '', 'url' => $url, 'life' => $life, 'action' => '');
     if (is_array($content)) {
         $msg = array_merge($msg, $content, array('type' => 'success'));
     } else {
         $msg['content'] = $content;
     }
     msg::show($msg);
 }
Пример #13
0
 function get_msg()
 {
     $out = '';
     if (!empty($_SESSION['msg'])) {
         $out = $_SESSION['msg'];
     }
     $_SESSION['msg'] = '';
     msg::reset();
     return $out;
 }
Пример #14
0
 function update()
 {
     $manager = new manager();
     $manager->db->where('id=' . (int) $_GET['id']);
     $res = $manager->db->update($_POST);
     if ($res === false) {
         msg::info('back', $manager->db->msg, 'error');
     } else {
         msg::info('?c=manager');
     }
 }
Пример #15
0
 function update()
 {
     $__table__ = new __table__();
     $__table__->db->where('id=' . (int) $_GET['id']);
     $arr = $__table__->checkData($_POST);
     $res = $__table__->db->update($arr);
     if ($res === false) {
         msg::info('back', $__table__->db->msg, 'error');
     } else {
         msg::info('?c=__table__');
     }
 }
Пример #16
0
 /**
  * 显示成功消息
  *
  */
 public static function success($content = '', $url = '', $life = 3, $extra = '')
 {
     $msg = array('type' => 'success', 'title' => 'success', 'content' => '', 'life' => 0);
     if (is_array($content)) {
         $msg = array_merge($msg, $content);
     } else {
         $msg['content'] = $content;
         $msg['url'] = $url;
         $msg['extra'] = $extra;
         $msg['life'] = $life;
     }
     $msg['type'] = 'success';
     msg::show($msg);
 }
Пример #17
0
 public function actionBakup()
 {
     $db = zotop::model('database.database');
     if (form::isPostBack()) {
         msg::error('功能开发中……');
     }
     $database = $db->db()->config();
     $tables = $db->tables();
     $page = new page();
     $page->title = '数据库备份';
     $page->set('position', $database['database'] . ' @ ' . $database['hostname']);
     $page->set('navbar', $this->navbar());
     $page->set('database', $database);
     $page->set('tables', $tables);
     $page->display();
 }
Пример #18
0
 public function actionUpload()
 {
     $config = zotop::model('zotop.config');
     if (form::isPostBack()) {
         $post = form::post();
         $save = $config->save($post);
         if ($save) {
             msg::success('保存成功,重新加载中,请稍后……');
         }
         msg::error($save);
     }
     $fields = $config->fields('upload');
     $page = new page();
     $page->set('title', '上传设置');
     $page->set('navbar', $this->navbar());
     $page->set('fields', $fields);
     $page->display();
 }
Пример #19
0
 public function actionTheme()
 {
     $config = zotop::model('system.config');
     if (form::isPostBack()) {
         $post = form::post();
         $config->save($post);
         if ($config->error()) {
             msg::error($config->msg());
         }
         msg::success('保存成功');
     }
     $theme = $config->fields('system.theme');
     $page = new page();
     $page->set('title', zotop::t('系统设置'));
     $page->set('navbar', $this->navbar());
     $page->set('theme', $theme);
     $page->display();
 }
Пример #20
0
 public function onEdit($file)
 {
     if (form::isPostBack()) {
         $content = request::post('source');
         msg::success('保存测试', '测试,继续编辑或者返回' . zotop::dump($content, true), 'reload');
     }
     $source = file::read(ROOT . $file);
     $page['title'] = '文件编辑器';
     page::header($page);
     page::top();
     page::navbar($this->navbar());
     form::header(array('class' => 'sourceEditor'));
     form::field(array('type' => 'label', 'label' => zotop::t('文件名称'), 'name' => 'filename', 'value' => $file, 'valid' => '', 'description' => zotop::t('')));
     form::field(array('type' => 'source', 'label' => zotop::t('文件内容'), 'name' => 'source', 'value' => $source, 'valid' => 'required:true', 'description' => zotop::t('')));
     form::buttons(array('type' => 'submit', 'value' => '保存文件'), array('type' => 'back'));
     form::footer();
     page::bottom();
     page::footer();
 }
Пример #21
0
 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();
 }
Пример #22
0
 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();
 }
Пример #23
0
 public function actionEdit($file = '')
 {
     $file = empty($file) ? zotop::get('file') : $file;
     $file = trim(url::decode($file), '/');
     $filepath = ZOTOP_PATH_ROOT . DS . str_replace('/', DS, $file);
     if (form::isPostBack()) {
         $content = request::post('source');
         $content = trim($content);
         if (empty($content)) {
             msg::error('内容为空,无法保存!');
         }
         file::write($filepath, trim($content));
         msg::success('内容保存成功!');
     }
     $filecontent = file::read($filepath);
     $page = new dialog();
     $page->title = '文件编辑器';
     $page->set('file', $file);
     $page->set('filepath', $filepath);
     $page->set('filecontent', $filecontent);
     $page->display();
 }
Пример #24
0
 public function actionEdit($file)
 {
     $filepath = realpath(ZOTOP_PATH_ROOT . DS . trim($file, '/'));
     if (empty($file)) {
         return false;
     }
     if (form::isPostBack()) {
         $content = request::post('source');
         $content = trim($content);
         if (empty($content)) {
             msg::error('内容为空,无法保存!');
         }
         file::write($filepath, trim($content));
         msg::success('内容保存成功!');
     }
     $content = file::read($filepath);
     $page = new dialog();
     $page->title = '文件编辑器';
     $page->set('file', $file);
     $page->set('filepath', $filepath);
     $page->set('content', $content);
     $page->display();
 }
Пример #25
0
$set_theme = $my_app->get_param('set_theme');
if (!empty($set_theme)) {
    globalconfig('theme', $my_app->get_param('theme_id'));
    $my_app->set_param('set_theme', null);
    cache_param('set_theme');
    helper_result('config_update', 'ok', txt('updated'));
    helper_result('config_update_result', 'result', 'success');
}
$theme_id = $my_app->get_param('theme_id');
if (empty($theme_id)) {
    $my_app->set_param('theme_id', globalconfig('theme'));
}
cache_param('theme_id');
$my_app->set_param('selected_theme_id', globalconfig('theme'));
cache_param('selected_theme_id');
$my_app->jquery_onready(msg::showMessages());
$action = $my_app->get_param('action');
switch ($action) {
    case 'delete':
        $delete_id = $my_app->get_param('delete_id');
        if ($ftp->delete_ftp($delete_id)) {
            helper_result('delete_ftp', 'ok', txt('deleted'));
            $my_app->set_param('action', null);
            cache_param('action');
        }
        break;
}
if (form_submit('config_site')) {
    if ($_POST['action'] == 'config_site') {
        globalconfig('site_title', strip_tags($_POST['site_title']));
        globalconfig('site_desc', strip_tags($_POST['site_desc']));
Пример #26
0
#	Project: PHPDISK File Storage Solution
#	This is NOT a freeware, use is subject to license terms.
#
#	Site: http://www.google.com
#
#	$Id: vip.php 121 2014-03-04 12:38:05Z along $
#
#	Copyright (C) 2008-2014 PHPDisk Team. All Rights Reserved.
#
*/
include "includes/commons.inc.php";
if (!$auth[buy_vip_a] && !$auth[buy_vip_p]) {
    exit(msg::umsg('Not_FMS', __('zcore_no_power')));
}
if (!$settings[open_vip]) {
    exit(msg::umsg('Not_VIP_MODE', __('zcore_no_power')));
}
$in_front = true;
$title = __('buy_vip') . ' - ' . $settings['site_title'];
include PHPDISK_ROOT . "./includes/header.inc.php";
/*
$vip_id = get_profile($pd_uid,'vip_id');
if($vip_id){
	$vip_end_time = get_profile($pd_uid,'vip_end_time');
	if($vip_end_time>$timestamp){
		$vip_end_time_txt = date('Y-m-d',get_profile($pd_uid,'vip_end_time'));
	}else{
		$vip_end_time_txt = date('Y-m-d',get_profile($pd_uid,'vip_end_time')).', <span class="txtred">('.__('vip_end_time_expire').')</span>';
	}
	$my_vip = __('my_vip_is').get_vip($vip_id,'subject').' , '.$vip_end_time_txt;
}else{
Пример #27
0
 public function actionDelete($id)
 {
     $config = zotop::model('system.config');
     $config->id = $id;
     $config->read();
     if ($config->childNum($id) > 0) {
         msg::error('该项下面尚有子项,无法被删除!');
     }
     $delete = $config->delete();
     if ($delete) {
         $config->cache(true);
         msg::success('删除成功,重新加载中,请稍后……', zotop::url('system/config/index/' . $config->parentid));
     }
 }
Пример #28
0
<?php

session_start();
if (!isset($_SESSION['user'])) {
    header('location: login.php');
}
require_once 'include/clases.php';
if (isset($_POST["altausuario"])) {
    if ($_SESSION['tipo'] == 'ADM') {
        user::add($_POST["nombre"], $_POST["apellido"], $_POST["email"], $_POST["username"], $_POST["pass1"], $_POST["pass2"], @$_POST["adm"]);
    }
    var_dump(msg::get());
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script style="color: rgb(0, 0, 0);" src="js/jquery-1.11.1.min.js"></script>
<!---<script src="https://code.jquery.com/jquery-1.10.2.js"></script>--->
     <script src="js/functions.js"></script>
     <script src="js/colors.js"></script>
    <script src="js/funciones.js"></script>
    <script src="js/switchery.min.js"></script>
    <link rel="stylesheet" type="text/css" media="all" href="css/styles-form.css">
    <link rel="stylesheet" type="text/css" media="all" href="css/switchery.min.css">
    
<link href="css/style.css" rel="stylesheet" type="text/css" media="all">
<link href="css/estilo.css" rel="stylesheet" type="text/css" media="all">
    
<title>[StockMGR]</title>
<link rel="icon" 
                        }
                    }
                }
                if (!$stop_upload) {
                    $phposFS->ftp_view($my_app->get_param('action_param'));
                    $my_app->set_param('action_param', null);
                    cache_param('action_param');
                }
                break;
            case 'paste':
                $clipboard = new phpos_clipboard();
                $mode = $clipboard->get_mode();
                if ($mode == 'copy') {
                    if ($phposFS->copy($my_app->get_param('action_param'))) {
                        msg::ok(txt('file_pasted'));
                    }
                } elseif ($mode == 'cut') {
                    $source_win = $clipboard->get_source_win();
                    if ($phposFS->cut($my_app->get_param('action_param'))) {
                        echo '<script>phpos.windowRefresh("' . $source_win . '", "");</script>';
                        msg::ok(txt('file_pasted'));
                    }
                }
                break;
        }
        $my_app->set_param('action_id', null);
        cache_param('action_id');
    }
}
$my_app->set_param('action_id', null);
cache_param('action_id');
Пример #30
0
 public function sms()
 {
     //注册时发送的验证码
     vendor('Sms.Sms');
     $phone = $_POST["username"];
     $method = $_POST["method"];
     /*$rules=array(
     			array('username','','手机号已经存在!',0,'unique',1), // 在新增的时候验证name字段是否唯一
     		);
     		*/
     $user = M("user_manage");
     //检查手机号的合法性
     if (preg_match("/1[34578]{1}\\d{9}/", $phone)) {
         //$result=;
         //isset($result));
         if ($method == "lostpass") {
             //找回密码
             if ($user->where("username={$phone} and state=1")->find()) {
                 $verify = rand(1000, 9999);
                 vendor('Msg.msg');
                 $msg = new \msg(M());
                 $m = $msg->createMsg(0, 'repass', array('validNum' => $verify));
                 //$m="您的验证码为$verify";
                 $sms = new \Sms();
                 $tag = $sms->sendSMS($phone, $m);
                 if ($tag == 1) {
                     //数据库中改手机号已经注册,但未注册成功
                     $data["validity"] = time();
                     $data["verify"] = $verify;
                     $user->where("username={$phone}")->save($data);
                 }
                 echo $tag;
             } else {
                 echo "手机号未注册";
             }
         } else {
             //首次注册
             //检查手机号是否注册成功
             if ($user->where("username={$phone} and state=1")->find()) {
                 echo "手机号已经注册";
             } else {
                 $verify = rand(1000, 9999);
                 vendor('Msg.msg');
                 $msg = new \msg(M());
                 $m = $msg->createMsg(0, 'login', array('validNum' => $verify));
                 $sms = new \Sms();
                 $tag = $sms->sendSMS($phone, $m);
                 if ($tag == 1) {
                     $result = $user->where("username={$phone} and state=1")->find();
                     if ($result) {
                         //数据库中改手机号已经注册,但未注册成功
                         $data["validity"] = time();
                         $data["verify"] = $verify;
                         $user->where("username={$phone}")->save($data);
                     } else {
                         //数据库改手机号未注册过
                         $data["username"] = $phone;
                         $data["state"] = 0;
                         $data["verify"] = $verify;
                         $data["validity"] = time();
                         $user->add($data);
                     }
                 }
                 echo $tag;
             }
         }
     } else {
         echo "您的手机号码不合法";
     }
 }