コード例 #1
0
function Login()
{
    if ($_COOKIE["ID_USUARIO"] == "") {
        msg_box("ERRO! Faça Login.");
        parent . location("index.php");
    }
}
コード例 #2
0
function restrict_access($levels)
{
    if (!user_access($levels)) {
        // Access forbidden
        $user_level = $_SESSION['permissions'];
        if ($user_level == 'X') {
            alert('You need to log in to do that.', -1);
            require_once PATH::root() . '/Account/Signin.php';
            die;
        } else {
            if ($user_level == 'E') {
                location('Account/Verify_Email');
            } else {
                if ($user_level == 'P') {
                    location('Account/Approve');
                } else {
                    if ($user_level == '+') {
                        location('Admin/Super_Admin');
                    } else {
                        if ($user_level == 'B') {
                            location('Account/Banned');
                        } else {
                            // Go home - e.g. if you're logged in and it's restrict_access('X') on Signin, you shouldn't be signing in again. It'll just bring you back home.
                            location('Home');
                        }
                    }
                }
            }
        }
    }
}
コード例 #3
0
 public function OtherLogin()
 {
     $ary_get = $this->_get();
     $ary_data = array();
     $ary_data['state'] = $_SESSION['state'] = md5(uniqid(rand(), TRUE));
     if ($ary_get['t'] == 'qq') {
         $ary_data['scope'] = $_SESSION['scope'] = "get_user_info,add_share,get_info,list_album,add_album,upload_pic,add_topic,add_one_blog,add_weibo";
     } else {
         if ($ary_get['t'] == 'tqq') {
             $ary_data['scope'] = 'all';
         } else {
             if ($ary_get['scope']) {
                 $ary_data['scope'] = 'email,direct_messages_write,direct_messages_read,friendships_groups_read,friendships_groups_write,statuses_to_me_read';
             }
         }
     }
     $ary_data['response_type'] = "code";
     $url = str_replace('__APP__/', '/', 'http://' . $_SERVER['HTTP_HOST'] . U('Home/Oauth/OtherCallbackLogin', array('t' => $ary_get['t'])));
     $ary_data['redirect_uri'] = $url;
     $type = ucwords($ary_get['t']);
     $config = M("Oauth")->where(array('code' => $type, 'status' => '1'))->find();
     $ary_config = json_decode($config['config'], true);
     ${$ary_get}['t'] = new $type($ary_config['app_key'], $ary_config['app_secret']);
     $loginUrl = ${$ary_get}['t']->getOauthUrl($ary_data);
     location($loginUrl);
     exit;
 }
コード例 #4
0
ファイル: Administrator_0.php プロジェクト: cretzu89/EPESI
 public function admin()
 {
     if ($this->is_back()) {
         if ($this->parent->get_type() == 'Base_Admin') {
             $this->parent->reset();
         } else {
             location(array());
         }
         return;
     }
     $form = $this->init_module(Libs_QuickForm::module_name(), 'Changing template');
     $themes = Base_Theme::list_themes();
     $form->addElement('header', 'install_module_header', __('Themes Administration'));
     $form->addElement('select', 'theme', __('Choose template'), $themes);
     $form->addElement('static', null, '', '<br /><br />');
     $form->addElement('header', 'upload_theme_header', __('Upload template'));
     $form->setDefaults(array('theme' => Variable::get('default_theme')));
     if ($form->validate()) {
         $form->process(array(&$this, 'submit_admin'));
     } else {
         $form->display();
         if (class_exists('ZipArchive')) {
             $this->pack_module(Utils_FileUpload::module_name(), array(array($this, 'upload_template'), __('Upload template')));
             //				Base_ActionBarCommon::add('edit',__('Manage templates'),$this->create_callback_href(array($this,'download_template')));
         }
     }
     Base_ActionBarCommon::add('back', __('Back'), $this->create_back_href());
     Base_ActionBarCommon::add('save', __('Save'), $form->get_submit_form_href());
 }
コード例 #5
0
 public function process()
 {
     $http_host = $_SERVER['HTTP_HOST'];
     if ($http_host == 'localhost:8080') {
         $http_host = 'localhost';
     }
     $host_name = 'http://' . $http_host;
     $actual_url = str_replace($host_name, '', APPLICATION_ROOT);
     $actual_url = str_replace($actual_url, '', $_SERVER['REQUEST_URI']);
     $size = $this->getP3();
     if (!$size) {
         location('/error/base/' . urlencode('The url was invalid'));
     }
     $size_ex = explode('x', $size);
     $height = isset($size_ex[0]) ? $size_ex[0] : '100';
     $width = isset($size_ex[1]) ? $size_ex[1] : '100';
     $image_path = str_replace('/images/process/' . $size, '', $actual_url);
     $full_image_path = 'http://' . $http_host . $image_path;
     $headers = get_headers($full_image_path);
     foreach ($headers as $header) {
         if (strpos($header, 'Content-Type') !== false) {
             header($header);
         }
     }
     $new_url = 'http://' . $http_host . href('/framework/external/timthumb/timthumb.php');
     $new_url .= '?src=' . $image_path;
     $new_url .= '&h=' . $height;
     $new_url .= '&w=' . $width;
     echo file_get_contents($new_url);
 }
コード例 #6
0
ファイル: Security.php プロジェクト: stefda/pocketsail
 public static function redirectWhenNotSignedIn()
 {
     $session = CL_Session::get_instance();
     $id = $session->get('signedId');
     if ($id === FALSE) {
         location('/user/login');
         exit;
     }
 }
コード例 #7
0
ファイル: CommonData_0.php プロジェクト: 62BRAINS/EPESI
	/**
	 * For internal use only.
	 */
	public function admin() {
		if($this->is_back()) {
			if($this->parent->get_type()=='Base_Admin')
				$this->parent->reset();
			else
				location(array());
			return;
		}
		Base_ActionBarCommon::add('back',__('Back'),$this->create_back_href());

		$this->browse();
	}
コード例 #8
0
 public function login()
 {
     //如果已经登录则,进入主页
     if ($this->admin_id) {
         location(U(MODULE_NAME . '/Index/index'));
         exit;
     }
     //如果没有登录
     if (!IS_POST) {
         $this->display();
         exit;
     }
     //获取表单数据
     $passwd = $_POST['passwd'];
     $name = $_POST['username'];
     //验证数据
     /* if (!$this->checkCaptcha($_POST['codeinput'])) {
            $this->error('验证码错误!');
        } */
     /* 验证是否存在该用户 */
     $admin = D('sys_admin');
     $data_get = $admin->where("name='%s'", $name)->find();
     if (!$data_get) {
         $this->error('该用户不存在');
         exit;
     }
     //如果该用户被锁定则不能登入
     if ($data_get['lock']) {
         $this->error('该用户已被锁定!!!请换其他帐号登录');
         exit;
     }
     //验证密码是否正确
     if (!strcmp(md5($passwd), $data_get['password'])) {
         $admin->where("id='%d'", $data_get['id'])->setField('login_ip', $_SERVER['REMOTE_ADDR']);
         //存入session
         session('admin_info', array('admin_id' => $data_get['id'], 'secret_key' => md5($data_get['id'] . C('secret_key')), 'admin_authority' => M('sys_role')->where('id="%d"', $data_get['role_id'])->getField('authority'), 'admin_name' => $data_get['name']));
         //存入cookie
         cookie('admin_info', array('admin_name' => $data_get['name']));
         //获取登录用户管理模块
         $lAuthLogic = D('Auth', 'Logic');
         $return = $lAuthLogic->init_auth($data_get);
         if ($return['status'] != 1) {
             $this->error($return['info']);
             exit;
         } else {
             redirect(U('Index/index'));
         }
     } else {
         $this->error('密码验证失败');
         exit;
     }
 }
コード例 #9
0
ファイル: LoginCommon_0.php プロジェクト: cretzu89/EPESI
 public static function submit_login($x)
 {
     $username = $x[0];
     $pass = $x[1];
     $ret = Base_User_LoginCommon::check_login($username, $pass);
     if (!$ret) {
         $limit_exceeded = self::log_failed_login($username);
         if ($limit_exceeded) {
             location(array());
         }
     }
     return $ret;
 }
コード例 #10
0
ファイル: Countries_0.php プロジェクト: cretzu89/EPESI
 public function admin()
 {
     if ($this->is_back()) {
         if ($this->parent->get_type() == 'Base_Admin') {
             $this->parent->reset();
         } else {
             location(array());
         }
         return;
     }
     Base_ActionBarCommon::add('back', __('Back'), $this->create_back_href());
     $this->pack_module(Utils_CommonData::module_name(), 'Countries', 'admin_array');
 }
コード例 #11
0
ファイル: TaxRates_0.php プロジェクト: cretzu89/EPESI
 public function admin()
 {
     if ($this->is_back()) {
         if ($this->parent->get_type() == 'Base_Admin') {
             $this->parent->reset();
         } else {
             location(array());
         }
         return;
     }
     Base_ActionBarCommon::add('back', __('Back'), $this->create_back_href());
     $this->rb = $this->init_module(Utils_RecordBrowser::module_name(), 'data_tax_rates', 'data_tax_rates_module');
     $this->display_module($this->rb);
 }
コード例 #12
0
ファイル: history.php プロジェクト: 62BRAINS/EPESI
 public static function forward()
 {
     if (self::is_forward()) {
         $_SESSION['client']['__history_id__']++;
     }
     self::$action = true;
     $data = DB::GetOne('SELECT data FROM history WHERE session_name=%s AND page_id=%d AND client_id=%d', array(self::session_id(), $_SESSION['client']['__history_id__'] - 1, CID));
     //		$data = DB::BlobDecode($data);
     if (GZIP_HISTORY && function_exists('gzuncompress')) {
         $data = gzuncompress($data);
     }
     $_SESSION['client']['__module_vars__'] = unserialize($data);
     location(array());
 }
コード例 #13
0
ファイル: Attachment_0.php プロジェクト: 62BRAINS/EPESI
	public function admin() {
		if ($this->is_back()) {
			$this->parent->reset();
		}
		Base_ActionBarCommon::add('back', __('Back'), $this->create_back_href());

		$google_login = Variable::get('utils_attachments_google_user', false);
		$google_pass = Variable::get('utils_attachments_google_pass', false);

		$form = $this->init_module('Libs_QuickForm');
		$theme = $this->init_module('Base_Theme');

		$form->addElement('header', 'header', __('Google Username and Password'));

		$form->addElement('text', 'google_user', __('Username'));
		$form->addElement('password', 'google_pass', __('Password'));

		$form->setDefaults(array('google_user'=>$google_login));
		$form->setDefaults(array('google_pass'=>$google_pass));

		if ($form->validate()) {
			$vals = $form->exportValues();

			$ok = true;
			if ($vals['google_user']) {
				$g_auth = Utils_AttachmentCommon::get_google_auth($vals['google_user'], $vals['google_pass']);
				if (!$g_auth) $ok = false;
			}

			if ($ok) {
				Variable::set('utils_attachments_google_user', $vals['google_user']);
				Variable::set('utils_attachments_google_pass', $vals['google_pass']);

				Base_StatusBarCommon::message(__('Settings saved'));
			} else {
				Base_StatusBarCommon::message(__('Unable to authenticate'), 'error');
			}
			location(array());
			return;
		}

		$form->assign_theme('form', $theme);

		Base_ActionBarCommon::add('back', __('Back'), $this->create_back_href());
		Base_ActionBarCommon::add('save', __('Save'), $form->get_submit_form_href());
		
		Base_ThemeCommon::load_css('Utils_RecordBrowser','View_entry');
		$theme->display('admin');
	}
コード例 #14
0
ファイル: QuickSearch_0.php プロジェクト: 62BRAINS/EPESI
 public function admin()
 {
     if ($this->is_back()) {
         if ($this->parent->get_type() == 'Base_Admin') {
             $this->parent->reset();
         } else {
             location(array());
         }
         return;
     }
     Base_ActionBarCommon::add('back', __('Back'), $this->create_back_href());
     $this->rb = $this->init_module('Utils/RecordBrowser', 'quick_search', 'quick_searach');
     $this->display_module($this->rb);
     return true;
 }
コード例 #15
0
 private static function parseurl()
 {
     if (isset($_REQUEST['act']) && isset($_REQUEST['mod'])) {
         $act = ucfirst(trim($_REQUEST['act']) . 'Action');
         $method = trim($_REQUEST['mod']);
     } else {
         $act = 'IndexAction';
         $method = 'index';
     }
     if (isset($_REQUEST['app']) && !defined('APP_NAME')) {
         define('APP_NAME', trim($_REQUEST['app']));
     }
     if (CREATE_DEMO) {
         //if need create demo
         $demo = new Demo();
         $demo->run();
     }
     if (!class_exists($act)) {
         if (APP_DEBUG) {
             die('controller class: ' . $act . ' not find. ');
         } else {
             location();
         }
     }
     $controller = new $act();
     if (!method_exists($controller, $method)) {
         if (APP_DEBUG) {
             die('controller class: ' . $act . ', method: ' . $method . ' not find. ');
         } else {
             location();
         }
     }
     self::$controller_obj = $controller;
     $controller->method = $method;
     $controller->open_token = OPEN_TOKEN;
     $controller->act = str_ireplace('Action', '', $act);
     self::$act = $controller->act;
     self::$mod = $method;
     $controller->{$method}();
 }
コード例 #16
0
ファイル: CurrencyField_0.php プロジェクト: cretzu89/EPESI
 public function admin()
 {
     if ($this->is_back()) {
         if ($this->parent->get_type() == 'Base_Admin') {
             $this->parent->reset();
         } else {
             location(array());
         }
         return;
     }
     $gb = $this->init_module('Utils_GenericBrowser', null, 'currencies');
     $gb->set_table_columns(array(array('name' => __('ID')), array('name' => __('Code')), array('name' => __('Symbol')), array('name' => __('Symbol position')), array('name' => __('Decimal sign')), array('name' => __('Thousand sign')), array('name' => __('Decimals')), array('name' => __('Default')), array('name' => __('Active'))));
     $ret = DB::Execute('SELECT * FROM utils_currency ORDER BY id ASC');
     while ($row = $ret->FetchRow()) {
         $gb_row = $gb->get_new_row();
         $gb_row->add_data_array(array($row['id'], $row['code'], $row['symbol'], self::$positions[$row['pos_before']], $row['decimal_sign'], $row['thousand_sign'], $row['decimals'], self::$active[$row['default_currency']], self::$active[$row['active']]));
         $gb_row->add_action($this->create_callback_href(array($this, 'edit_currency'), array($row['id'])), 'edit');
     }
     Base_ActionBarCommon::add('add', __('New'), $this->create_callback_href(array($this, 'edit_currency'), array(null)));
     Base_ActionBarCommon::add('back', __('Back'), $this->create_back_href());
     $this->display_module($gb);
 }
コード例 #17
0
ファイル: Filters_0.php プロジェクト: 62BRAINS/EPESI
 public function body()
 {
     if (!Acl::is_user()) {
         return;
     }
     $th = $this->init_module('Base/Theme');
     eval_js_once('crm_filters_deactivate = function(){leightbox_deactivate(\'crm_filters\');}');
     $th->assign('my', '<a ' . $this->create_callback_href(array('CRM_FiltersCommon', 'set_profile'), 'my') . ' id="crm_filters_my">' . __('My records') . '</a>');
     eval_js('Event.observe(\'crm_filters_my\',\'click\', crm_filters_deactivate)');
     /*$th->assign('all','<a '.$this->create_callback_href(array('CRM_FiltersCommon','set_profile'),'all').' id="crm_filters_all">'.__('All records').'</a>');
     		eval_js('Event.observe(\'crm_filters_all\',\'click\', crm_filters_deactivate)');*/
     $th->assign('manage', '<a ' . $this->create_callback_href(array($this, 'manage_filters')) . ' id="crm_filters_manage">' . __('Manage presets') . '</a>');
     eval_js('Event.observe(\'crm_filters_manage\',\'click\', crm_filters_deactivate)');
     $ret = DB::Execute('SELECT id,name,description FROM crm_filters_group WHERE user_login_id=%d', array(Acl::get_user()));
     $filters = array();
     while ($row = $ret->FetchRow()) {
         $filters[] = array('title' => $row['name'], 'description' => '', 'open' => '<a ' . Utils_TooltipCommon::open_tag_attrs($row['description'], false) . ' ' . $this->create_callback_href(array('CRM_FiltersCommon', 'set_profile'), $row['id']) . ' id="crm_filters_' . $row['id'] . '">', 'close' => '</a>');
         eval_js('Event.observe(\'crm_filters_' . $row['id'] . '\',\'click\', crm_filters_deactivate)');
     }
     $th->assign('filters', $filters);
     $qf = $this->init_module('Libs/QuickForm');
     $fcallback = array('CRM_ContactsCommon', 'contact_format_no_company');
     $recent_crits = array();
     if (!Base_User_SettingsCommon::get('CRM_Contacts', 'show_all_contacts_in_filters')) {
         $recent_crits = array('(company_name' => CRM_ContactsCommon::get_main_company(), '|related_companies' => array(CRM_ContactsCommon::get_main_company()));
     }
     if (Base_User_SettingsCommon::get('CRM_Contacts', 'show_only_users_in_filters')) {
         $recent_crits['!login'] = '';
     }
     $contacts = CRM_ContactsCommon::get_contacts($recent_crits, array(), array(), 15);
     $cont = array();
     foreach ($contacts as $v) {
         $cont[$v['id']] = call_user_func($fcallback, $v, true);
     }
     asort($cont);
     $crits = array();
     if (!Base_User_SettingsCommon::get('CRM_Contacts', 'show_all_contacts_in_filters')) {
         $crits = array('(company_name' => CRM_ContactsCommon::get_main_company(), '|related_companies' => array(CRM_ContactsCommon::get_main_company()));
     }
     $qf->addElement('autoselect', 'crm_filter_contact', __('Records of'), $cont, array(array('CRM_ContactsCommon', 'autoselect_contact_suggestbox'), array($crits, $fcallback, false)), $fcallback);
     if (isset($_SESSION['client']['filter_' . Acl::get_user()]['value'])) {
         $qf->setDefaults(array('crm_filter_contact' => explode(',', $_SESSION['client']['filter_' . Acl::get_user()]['value'])));
     }
     $qf->addElement('submit', 'submit', __('Show'), array('onclick' => 'crm_filters_deactivate()'));
     if ($qf->validate()) {
         $c = $qf->exportValue('crm_filter_contact');
         CRM_FiltersCommon::set_profile('c' . $c);
         location(array());
     }
     $th->assign('saved_filters', __('Saved Presets'));
     $qf->assign_theme('contacts', $th);
     //$th->assign('contacts',$qf->toHtml());
     ob_start();
     $th->display();
     $profiles_out = ob_get_clean();
     Libs_LeightboxCommon::display('crm_filters', $profiles_out, __('Perspective'), true);
     if (!isset($_SESSION['client']['filter_' . Acl::get_user()]['desc'])) {
         CRM_FiltersCommon::set_profile('my');
     }
     //Base_ActionBarCommon::add('folder',__('Filters'),'class="lbOn" rel="crm_filters"',$this->get_module_variable('profile_desc',__('My records')));
     if (isset($_REQUEST['__location'])) {
         $in_use = CRM_FiltersCommon::$in_use === $_REQUEST['__location'];
     } else {
         $in_use = CRM_FiltersCommon::$in_use;
     }
     print '<a class="lbOn' . ($in_use ? '' : ' disabled') . ' button" rel="crm_filters">' . __('Perspective') . ': ' . '<b>' . $_SESSION['client']['filter_' . Acl::get_user()]['desc'] . '</b><div class="filter_icon_img"></div></a>';
 }
コード例 #18
0
ファイル: TasksCommon_0.php プロジェクト: 62BRAINS/EPESI
 public static function display_status($record, $nolink, $desc)
 {
     $prefix = 'crm_tasks_leightbox';
     $v = $record[$desc['id']];
     if (!$v) {
         $v = 0;
     }
     $status = Utils_CommonDataCommon::get_translated_array('CRM/Status');
     if ($v >= 3 || $nolink) {
         return $status[$v];
     }
     CRM_FollowupCommon::drawLeightbox($prefix);
     if (!Utils_RecordBrowserCommon::get_access('task', 'edit', $record) && !Base_AclCommon::i_am_admin()) {
         return $status[$v];
     }
     if (isset($_REQUEST['form_name']) && $_REQUEST['form_name'] == $prefix . '_follow_up_form' && $_REQUEST['id'] == $record['id']) {
         unset($_REQUEST['form_name']);
         $v = $_REQUEST['closecancel'];
         $action = $_REQUEST['action'];
         $note = $_REQUEST['note'];
         if ($note) {
             if (get_magic_quotes_gpc()) {
                 $note = stripslashes($note);
             }
             $note = str_replace("\n", '<br />', $note);
             Utils_AttachmentCommon::add('task/' . $record['id'], 0, Acl::get_user(), $note);
         }
         if ($action == 'set_in_progress') {
             $v = 1;
         }
         Utils_RecordBrowserCommon::update_record('task', $record['id'], array('status' => $v));
         if ($action == 'set_in_progress') {
             location(array());
         }
         $values = $record;
         $values['date_and_time'] = date('Y-m-d H:i:s');
         $values['title'] = __('Follow-up') . ': ' . $values['title'];
         $values['status'] = 0;
         if ($action != 'none') {
             $x = ModuleManager::get_instance('/Base_Box|0');
             $values['follow_up'] = array('task', $record['id'], $record['title']);
             if ($action == 'new_task') {
                 $x->push_main('Utils/RecordBrowser', 'view_entry', array('add', null, $values), array('task'));
             }
             if ($action == 'new_meeting') {
                 $x->push_main('Utils/RecordBrowser', 'view_entry', array('add', null, array('title' => $values['title'], 'permission' => $values['permission'], 'priority' => $values['priority'], 'description' => $values['description'], 'date' => date('Y-m-d'), 'time' => date('H:i:s'), 'duration' => 3600, 'status' => 0, 'employees' => $values['employees'], 'customers' => $values['customers'], 'follow_up' => $values['follow_up'])), array('crm_meeting'));
             }
             if ($action == 'new_phonecall') {
                 $x->push_main('Utils/RecordBrowser', 'view_entry', array('add', null, array('subject' => $values['title'], 'permission' => $values['permission'], 'priority' => $values['priority'], 'description' => $values['description'], 'date_and_time' => date('Y-m-d H:i:s'), 'employees' => $values['employees'], 'status' => 0, 'customer' => !empty($values['customers']) ? array_pop($values['customers']) : '', 'follow_up' => $values['follow_up'])), array('phonecall'));
             }
             return false;
         }
         location(array());
     }
     if ($v == 0) {
         return '<a href="javascript:void(0)" onclick="' . $prefix . '_set_action(\'set_in_progress\');' . $prefix . '_set_id(\'' . $record['id'] . '\');' . $prefix . '_submit_form();">' . $status[$v] . '</a>';
     }
     return '<a href="javascript:void(0)" class="lbOn" rel="' . $prefix . '_followups_leightbox" onMouseDown="' . $prefix . '_set_id(' . $record['id'] . ');">' . $status[$v] . '</a>';
 }
コード例 #19
0
ファイル: modify.php プロジェクト: dothin/bbs
        $html['switch'] = $rows['bbs_switch'];
        $html['signature'] = $rows['bbs_signature'];
        $html = html($html);
        //性别
        if ($html['sex'] == '男') {
            $html['sex_html'] = '<label for="man" class="radio"><input type="radio" id="man" name="sex" value="男" checked >男 </label>
                            <label for="woman" class="radio"><input type="radio" id="woman" name="sex" value="女" >女</label>';
        } else {
            $html['sex_html'] = '<label for="man" class="radio"><input type="radio" id="man" name="sex" value="男" >男 </label>
                            <label for="woman" class="radio"><input type="radio" id="woman" name="sex" value="女" checked >女</label>';
        }
    } else {
        alert('该用户不存在');
    }
} else {
    location('请先登录再进行本操作!', 'login.php');
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8" />
    <title>Document</title>
    <link rel="stylesheet" type="text/css" href="css/reset.css">
    <link rel="stylesheet" type="text/css" href="css/main.css">
</head>
<body>
    <?php 
require ROOT_PATH . 'includes/header.inc.php';
?>
    <div class="container oh uz">
コード例 #20
0
ファイル: Common.php プロジェクト: stefda/pocketsail
function handle_error($message, $trace)
{
    log_message($message . " " . json_encode($trace));
    if (DEBUG) {
        show_error($message, 'error', $trace);
    } else {
        location('/oops');
    }
    exit(-1);
}
コード例 #21
0
ファイル: install.php プロジェクト: klimjr/cms
    if ($count['count'] == 0) {
        $query = 'CALL get_max_position(:table_name, :table_column)';
        $params = array(':table_name' => PREF . 'modules', ':table_column' => 'position');
        $tmp = PdoWrap::selectRow($query, $params);
        $query = 'CALL modules_insert(:folder_field, :active_field, :position_field)';
        $params = array(':folder_field' => $folder, ':active_field' => 1, ':position_field' => $tmp['max'] + 1);
        //	Добавление записи в таблицу.
        PdoWrap::execute($query, $params);
    }
    /*
    // Подключение модуля
    if (is_file(DOC.'modules/'.$folder.'/'.$folder.'.class.php')) {
    
        require_once(DOC.'modules/'.$folder.'/'.$folder.'.class.php');
        if (class_exists($folder)) {
            $$folder = new $folder();
            $$folder->smarty = $smarty;
            $$folder->db = &$DB;
            $$folder->lang = $current_lang;
            $$folder->deflang = $default_lang;
            $$folder->langs = $langs;
    
            $$folder->createModuleTables();
    
            unset($$folder);
        }
    }
    */
    // Переадресация.
    location($__return);
}
コード例 #22
0
ファイル: login.php プロジェクト: klimjr/cms
<?php

//	Запрет на обращение к файлу.
if (realpath($_SERVER['SCRIPT_FILENAME']) == realpath(__FILE__)) {
    header('Location: /');
    exit;
}
if (isset($_SESSION['user'])) {
    header('Location: /admin/');
    exit;
}
$auth_loginname_str = Text::get_post('auth_loginname_str');
$auth_password_str = md5(Text::get_post('auth_password_str'));
$msg = '';
if (!empty($auth_loginname_str)) {
    $query = 'CALL `get_user_info`(:user_login, :user_pass)';
    $params = array(':user_login' => $auth_loginname_str, ':user_pass' => $auth_password_str);
    $result = PdoWrap::selectRow($query, $params);
    if (!empty($result)) {
        $return = '/admin/';
        if (Text::get_get('return') != '') {
            $return = urldecode(Text::get_get('return'));
        }
        $_SESSION['user'] = $result;
        location($return);
    } else {
        $msg = 'В доступе отказано';
    }
}
$smarty->assign('msg', $msg);
コード例 #23
0
ファイル: coming-soon.php プロジェクト: chroda/lolcollector
location(false, false, false);
?>
" />
		<meta charset	="utf-8"																	/>
		<meta name="author" 		content="Dev n' Quest">
		<meta name="keywords" 		content="collector lol LeagueOfLegends" />
		<meta name="description" 	content="Em breve" />
		<meta name="robots" 		content="FOLLOW" />
		<meta name="viewport" 		content="width=device-width, initial-scale=1.0">
		<meta name		="google-site-verification"	content="s8DCAf-SsBZCRT6UKG7Z6KsjPTLv_kAdt4Ld4N1adaQ" 	/>
		<meta property	="og:locale"				content="<?php 
echo $_SESSION['user']['locale'];
?>
"/>
		<meta property	="og:url"					content="<?php 
location(false, false, false);
?>
"/>
		<meta property	="og:title"					content="<?php 
echo $_SESSION['seo']['ptitle'];
?>
"/>
		<meta property	="og:site_name"				content="<?php 
echo $_SESSION['seo']['ptitle'];
?>
"/>
		<meta property	="og:description"			content="<?php 
echo $_SESSION['seo']['description'];
?>
"/>
		<meta property	="og:image" 				content="<?php 
コード例 #24
0
ファイル: FileUpload_0.php プロジェクト: cretzu89/EPESI
 /**
  * For internal use only.
  */
 public function submit_parent($data)
 {
     /*		error_log(date('Y-m-d H:i:s')."\n",3,'data/file_upload_err.txt');
     		if(!isset($_SESSION['client']['uploaded_file']) || !isset($_SESSION['client']['uploaded_original_file'])) {
     			E2::alert('Invalid upload - session expired?');
     			error_log(date('Y-m-d H:i:s').' '.print_r($_SESSION['client'],true)."\n\n\n",3,'data/file_upload_err.txt');
     			return;
     		}*/
     if (call_user_func_array($this->on_submit, array_merge(array($_SESSION['client']['uploaded_file'], $_SESSION['client']['uploaded_original_file'], $data), $this->on_submit_args))) {
         location(array());
     }
     @unlink($_SESSION['client']['uploaded_file']);
     unset($_SESSION['client']['uploaded_file']);
     unset($_SESSION['client']['uploaded_original_file']);
 }
コード例 #25
0
ファイル: users.php プロジェクト: andrii888/VFXHYIP
        $bads = array();
        while ($row = mysql_fetch_assoc($result)) {
            $bads[] = $row;
        }
        Project::getInstance()->getSmarty()->assign('bads', $bads);
        Project::getInstance()->getSmarty()->display('../default/admin/user_bad_withdrawals.tpl');
        break;
    case 'message':
        if (isset($_REQUEST['do']) && $_REQUEST['do'] == 'send') {
            $_POST = sql_escapeArray($_POST);
            $message = new UserMessage();
            $message->setData($_POST);
            $message->user_id = intval($_REQUEST['id']);
            $message->stamp = Project::getInstance()->getNow();
            $message->save();
            location($_SERVER['PHP_SELF'] . '?action=profile&id=' . intval($_REQUEST['id']), '<p class=imp>Message <u>' . htmlspecialchars($message->title) . '</u> has been send!</p>');
        }
        Project::getInstance()->getSmarty()->assign('user_id', intval($_REQUEST['id']));
        Project::getInstance()->getSmarty()->display('../default/admin/user_message.tpl');
        break;
    default:
        $result_ips = sql_query('
			SELECT user_id, INET_NTOA(ip) as ip FROM visits GROUP BY user_id, ip
		');
        $ips = array();
        while ($row_ips = mysql_fetch_assoc($result_ips)) {
            $ips[$row_ips['user_id']][$row_ips['ip']] = '';
        }
        $users_by_ips = array();
        $users_by_ips_result = sql_query('
			SELECT INET_NTOA(ip) as ip, CONVERT( GROUP_CONCAT( DISTINCT user_id )
コード例 #26
0
ファイル: manager_set.php プロジェクト: hachi-zzq/guest-cms
    $_clean['blog'] = $_POST['blog'];
    $_clean['photo'] = $_POST['photo'];
    $_clean['skin'] = $_POST['skin'];
    $_clean['post'] = $_POST['post'];
    $_clean['re'] = $_POST['re'];
    $_clean['code'] = $_POST['code'];
    $_clean['register'] = $_POST['register'];
    $_clean['string'] = $_POST['string'];
    $_clean = mysql_escape($_clean);
    mysql_query("UPDATE system SET \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tweb_name='{$_clean['web_name']}',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarticle_page='{$_clean['article']}',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tblog_page='{$_clean['blog']}',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tphoto_page='{$_clean['photo']}',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tskin='{$_clean['skin']}',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpost_time='{$_clean['post']}',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tre_time='{$_clean['re']}',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcode='{$_clean['code']}',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tregister='{$_clean['register']}',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tno_string='{$_clean['string']}'\r\n\t\t\t\t\t\t\t\t\t\t\t\tWHERE\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tid=1\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tLIMIT \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t1\r\n\t\t") or die(mysql_error());
    if (mysql_affected_rows() == 1) {
        mysql_close();
        location('恭喜你,修改成功', 'manager_set.php');
    } else {
        mysql_close();
        location('很遗憾,修改失败', 'manager_set.php');
    }
}
//开始获取system表的数据,如果存在数据
if (!!($row = mysql_fetch_array(mysql_query("select * from system where id=1"), MYSQL_ASSOC))) {
    $_html = array();
    $_html['webname'] = $row['web_name'];
    $_html['article'] = $row['article_page'];
    $_html['blog'] = $row['blog_page'];
    $_html['photo'] = $row['photo_page'];
    $_html['skin'] = $row['skin'];
    $_html['string'] = $row['no_string'];
    $_html['post'] = $row['post_time'];
    $_html['re'] = $row['re_time'];
    $_html['code'] = $row['code'];
    $_html['register'] = $row['register'];
コード例 #27
0
ファイル: EssClient_0.php プロジェクト: cretzu89/EPESI
 public function register_form($data = null)
 {
     if ($this->is_back()) {
         return false;
     }
     Base_ActionBarCommon::add('back', __('Back'), $this->create_back_href());
     $f = $this->init_module(Libs_QuickForm::module_name());
     $admin_email_tooltip = '<img ' . Utils_TooltipCommon::open_tag_attrs(__('This email will be used to send registation link and to contact Administator directly.'), false) . ' src="' . Base_ThemeCommon::get_icon('info') . '"/> ';
     $tax_id_tooltip = '<img ' . Utils_TooltipCommon::open_tag_attrs(__('Your company Tax ID for invoices.'), false) . ' src="' . Base_ThemeCommon::get_icon('info') . '"/> ';
     $f->addElement('text', 'company_name', __('Company Name'), array('maxlength' => 128));
     $f->addRule('company_name', __('Field required'), 'required');
     $f->addRule('company_name', __('Max length exceeded'), 'maxlength', 128);
     $f->addElement('text', 'short_name', __('Short Name'), array('maxlength' => 64));
     $f->addRule('short_name', __('Max length exceeded'), 'maxlength', 64);
     $f->addElement('text', 'phone', __('Phone'), array('maxlength' => 64));
     $f->addRule('phone', __('Max length exceeded'), 'maxlength', 64);
     $f->addElement('text', 'fax', __('Fax'), array('maxlength' => 64));
     $f->addRule('fax', __('Max length exceeded'), 'maxlength', 64);
     $f->addElement('text', 'email', __('Company email'), array('maxlength' => 128));
     $f->addRule('email', __('Max length exceeded'), 'maxlength', 128);
     $f->addRule('email', __('Invalid e-mail address'), 'email');
     $f->addElement('text', 'web_address', __('Web address'), array('maxlength' => 64));
     $f->addRule('web_address', __('Max length exceeded'), 'maxlength', 64);
     $f->addElement('text', 'address_1', __('Address 1'), array('maxlength' => 64));
     $f->addRule('address_1', __('Field required'), 'required');
     $f->addRule('address_1', __('Max length exceeded'), 'maxlength', 64);
     $f->addElement('text', 'address_2', __('Address 2'), array('maxlength' => 64));
     $f->addRule('address_2', __('Max length exceeded'), 'maxlength', 64);
     $f->addElement('text', 'city', __('City'), array('maxlength' => 64));
     $f->addRule('city', __('Field required'), 'required');
     $f->addRule('city', __('Max length exceeded'), 'maxlength', 64);
     $f->addElement('commondata', 'country', __('Country'), 'Countries');
     $f->addRule('country', __('Field required'), 'required');
     $f->addElement('commondata', 'zone', __('Zone'), array('Countries', 'country'), array('empty_option' => true));
     $f->addElement('text', 'postal_code', __('Postal Code'), array('maxlength' => 64));
     $f->addRule('postal_code', __('Field required'), 'required');
     $f->addRule('postal_code', __('Max length exceeded'), 'maxlength', 64);
     $f->addElement('text', 'tax_id', $tax_id_tooltip . __('Tax ID'), array('maxlength' => 64));
     $f->addRule('admin_email', __('Max length exceeded'), 'maxlength', 64);
     $f->addElement('text', 'admin_first_name', __('Administrator\'s first name'), array('maxlength' => 64));
     $f->addRule('admin_first_name', __('Field required'), 'required');
     $f->addRule('admin_first_name', __('Max length exceeded'), 'maxlength', 64);
     $f->addElement('text', 'admin_last_name', __('Administrator\'s last name'), array('maxlength' => 64));
     $f->addRule('admin_last_name', __('Field required'), 'required');
     $f->addRule('admin_last_name', __('Max length exceeded'), 'maxlength', 64);
     $f->addElement('text', 'admin_email', $admin_email_tooltip . __('Administrator\'s email'), array('maxlength' => 128));
     $f->addRule('admin_email', __('Field required'), 'required');
     $f->addRule('admin_email', __('Max length exceeded'), 'maxlength', 128);
     $f->addRule('admin_email', __('Invalid e-mail address'), 'email');
     if ($f->validate()) {
         $ret = $f->exportValues();
         $ret = Base_EssClientCommon::server()->register_installation_request($ret);
         if ($ret) {
             if (is_string($ret)) {
                 Base_EssClientCommon::set_license_key($ret);
             }
             location(array());
             return false;
         }
     }
     // set defaults
     print '<div class="important_notice">';
     print __('Enter Company and Administrator details. This data will be sent to EPESI Store Server to provide us with contact information. The data sent to EPESI Store Server is limited only to the data you enter using this form and what modules are being purchased and downloaded.');
     print '<br>';
     if ($data) {
         $f->setDefaults($data);
     } else {
         if (ModuleManager::is_installed('CRM_Contacts') > -1) {
             print '<span style="color:gray;font-size:10px;">' . __('Data below was auto-filled based on Main Company and first Super administrator. Make sure that the data is correct and change it if necessary.') . '</span>';
             $defaults = Base_EssClientCommon::get_possible_admin();
             $mc = CRM_ContactsCommon::get_main_company();
             if ($mc > 0) {
                 $company = CRM_ContactsCommon::get_company($mc);
                 if ($company) {
                     $defaults = array_merge($company, $defaults);
                 }
             }
             $f->setDefaults($defaults);
         }
     }
     if ($data) {
         if (isset($data['status']) && strcasecmp($data['status'], 'Confirmed') == 0) {
             print '<div style="color:gray;font-size:10px;">' . __('Updating Company data will require re-validation by our representative.') . '</div>';
         }
         print '<div style="color:red;font-size:10px;">' . __('Changing Administrator e-mail address will require e-mail confirmation.') . '</div>';
     }
     print '<center>';
     $f->addElement('submit', 'submit', $data ? __('Update') : __('Register'));
     $f->display_as_column();
     print '</center>';
     print '</div>';
     return true;
 }
コード例 #28
0
ファイル: Roundcube_0.php プロジェクト: 62BRAINS/EPESI
 public function paste($rs, $id)
 {
     if (isset($_SESSION['rc_mails_cp']) && is_array($_SESSION['rc_mails_cp']) && !empty($_SESSION['rc_mails_cp'])) {
         foreach ($_SESSION['rc_mails_cp'] as $mid) {
             $mail = Utils_RecordBrowserCommon::get_record('rc_mails', $mid);
             if (!in_array($rs . '/' . $id, $mail['related'])) {
                 $mail['related'][] = $rs . '/' . $id;
                 Utils_RecordBrowserCommon::update_record('rc_mails', $mid, array('related' => $mail['related']));
             }
         }
         location(array());
     }
 }
コード例 #29
0
ファイル: generatrix.php プロジェクト: nikhildixit/Generatrix
 private function getControllerAndMethod()
 {
     // Parse the values obtained from the url (obtained from .htaccess) to get the controller and view
     $details = array();
     if (USE_CATCH_ALL) {
         require_once path('/app/settings/mapping.php');
         $request = array();
         if ($this->cli->isEnabled()) {
             $request = $this->getCliArray();
         } else {
             $request = $this->getRequestArray();
         }
         $details = mapping($request);
         if (!checkArray($details, 'controller')) {
             $details['controller'] = isset($request[0]) && $request[0] != '' ? $request[0] : DEFAULT_CONTROLLER;
         }
         if (!checkArray($details, 'method')) {
             $details['method'] = isset($request[1]) && $request[1] != '' ? $request[1] : 'base';
         }
         // Do not destroy the generatrix controller
         $c_id = $this->cli->isEnabled() ? 1 : 0;
         if (isset($request[$c_id]) && $request[$c_id] == 'generatrix') {
             $details['controller'] = $request[$c_id];
             $c_id++;
             if (isset($request[$c_id]) && $request[$c_id] != '') {
                 $details['method'] = $request[$c_id];
             } else {
                 $details['method'] = 'base';
             }
         }
     } else {
         // If no controller or method is defined, we need to use the DEFAULT_CONTROLLER (defined in app/settings/config.php)
         // If cli is enabled, we use the format site.com/index.php controller function
         // 		Hence we need to get the values from the arguments as $argv[0], $argv[1] etc
         if ($this->cli->isEnabled()) {
             if ($this->cli->getValue('controller') == "") {
                 header('HTTP/1.1 301 Moved Permanently');
                 location('/' . DEFAULT_CONTROLLER);
             }
             $details['controller'] = $this->cli->getValue('controller') == "" ? DEFAULT_CONTROLLER : $this->cli->getValue('controller');
             $details['method'] = $this->cli->getValue('method') == "" ? 'base' : $this->cli->getValue('method');
         } else {
             // If this request is coming from the browser, we need to get the value from url (obtained from .htaccess)
             if ($this->request->getValue('controller') == "") {
                 header('HTTP/1.1 301 Moved Permanently');
                 location('/' . DEFAULT_CONTROLLER);
             }
             $details['controller'] = $this->request->getValue('controller') == "" ? DEFAULT_CONTROLLER : $this->request->getValue('controller');
             $details['method'] = $this->request->getValue('method') == "" ? 'base' : $this->request->getValue('method');
         }
         // TODO : Add customHandlers
         // We need to set the $controller and $method for the generatrix class
         $this->controller = function_exists('customHandlers') ? customHandlers($details, 'controller') : $details['controller'];
         $this->method = function_exists('customHandlers') ? customHandlers($details, 'method') : $details['method'];
         // set the controller and method again (depending on the customHandlers)
         $details['controller'] = $this->controller;
         $details['method'] = $this->method;
     }
     return $details;
 }
コード例 #30
0
ファイル: utils.lib.php プロジェクト: Reeska/restinpi
function refresh()
{
    location(strtok($_SERVER["REQUEST_URI"], "?"));
}