protected function renderContent()
 {
     /*$maxOrderNumber = Yii::app()->db->createCommand()
     	  ->select('max(id) as max')
     	  ->from('message_of_day')
     	  ->queryScalar();
     	$msg_id = $maxOrderNumber;*/
     $criteria = new CDbCriteria();
     $criteria->limit = 5;
     $criteria->order = 'id desc';
     $message = MessageOfDay::model()->findAll($criteria);
     if (!empty($message)) {
         foreach ($message as $list) {
             echo CHtml::link($list['message'], array('/messageOfDay/print_message', 'id' => $list['id']), array('id' => 'stud_doc_id2'));
             echo "</br></br>";
         }
     } else {
         echo '<div "id"="stud_doc_id2">';
         echo '</div>';
     }
     //echo CHtml::link('View All',array('/dashboard'),array('id'=>'stud_doc_id1'));
     $config = array('scrolling' => 'no', 'autoDimensions' => false, 'width' => '500', 'height' => '100', 'overlayColor' => '#000', 'padding' => '0', 'showCloseButton' => true, 'onClose' => function () {
         return window . location . reload();
     });
     $this->widget('application.extensions.fancybox.EFancyBox', array('target' => 'a#stud_doc_id2', 'config' => $config));
 }
예제 #2
0
function zaloguj($login, $haslo)
{
    //zabezpiecz zmienne
    $login = vText($login);
    $haslo = vText($haslo);
    //zaszyfruj hasło
    $haslo = md5($haslo);
    //pobierz dane z gabeli graczy o takim samym loginie i poprwanym haśle
    $id = row("select * from tribal_gracze where login = '******' and haslo ='" . $haslo . "' limit 1");
    if (!empty($id)) {
        //jeżeli coś pobrało
        //jeżeli gracz jest zbanowany
        if ($id['zbanowany'] == 1) {
            return "administracja zbanowała tego gracza";
        }
        if ($id['urlop'] > time()) {
            return "ten gracz jest na urlopie";
        }
        //jeżeli nie to zaloguj
        //wyczyść sesje
        $_SESSION = '';
        $_SESSION = array();
        //zapisz id gracza w sesji
        $_SESSION['gracz'] = $id['gracz'];
        //przejdź do strony konta gracza
        reload("konto");
    } else {
        return "podano niepoprawne dane";
    }
}
예제 #3
0
파일: user.php 프로젝트: RazorMarx/izend
function user($lang, $arglist = false)
{
    global $login_verified, $base_url;
    $login = build('login', $lang);
    if ($login === true) {
        $r = !empty($arglist['r']) ? $arglist['r'] : false;
        if ($login_verified and array_intersect($login_verified, user_profile('role'))) {
            $user = $_SESSION['user'];
            unset($_SESSION['user']);
            if (empty($_SERVER['HTTPS']) or $_SERVER['HTTPS'] == 'off') {
                return run('error/unauthorized', $lang);
            }
            $_SESSION['unverified_user'] = $user;
            $next_page = url('sslverifyclient');
            if ($r) {
                $next_page .= '?r=' . $r;
            }
        } else {
            $next_page = $r ? $r : url('home', $lang);
        }
        return reload($base_url . $next_page);
    }
    $banner = build('banner', $lang);
    $content = view('user', $lang, compact('login'));
    head('title', translate('user:title', $lang));
    head('description', false);
    head('keywords', false);
    head('robots', 'noindex, nofollow');
    $output = layout('standard', compact('banner', 'content'));
    return $output;
}
 protected function renderContent()
 {
     //echo 'Notice Content';
     /*
     $result=ImportantNotice::model()->findAll(array('limit'=>1,'order'=>'notice_id desc'));
     foreach($result as $data)
     */
     $notice;
     $id = Yii::app()->user->getState('org_id');
     if (!empty($id)) {
         $maxOrderNumber = Yii::app()->db->createCommand()->select('max(notice_id) as max')->from('important_notice')->where('notice_organization_id=' . $id)->queryScalar();
         if ($maxOrderNumber) {
             $notice_id = $maxOrderNumber;
             $notice = ImportantNotice::model()->findByPk($notice_id);
             $notice = $notice->notice;
             $notice = substr($notice, 0, 50) . "...";
             $this->widget('ext.bbcnewsticker.EBBCNewsTicker', array('items' => array(CHtml::link($notice, array('/importantNotice/print_notice', 'id' => $notice_id), array('id' => 'hello'))), 'wrapperHtmlOptions' => array('id' => "hello")));
             //$this->widget('ext.eticker.ETicker',array('data'=>array($notice, CHtml::link($notice,array('/importantNotice/print_notice','id'=>$notice_id),array('id'=>'stud_doc_id1')))));
             //echo CHtml::link($notice,array('/importantNotice/print_notice','id'=>$notice_id),array('id'=>'stud_doc_id1'));
             $config = array('scrolling' => 'no', 'autoDimensions' => false, 'width' => '500', 'height' => '100', 'overlayColor' => '#000', 'padding' => '0', 'showCloseButton' => true, 'onClose' => function () {
                 return window . location . reload();
             });
             $this->widget('application.extensions.fancybox.EFancyBox', array('target' => '#hello', 'config' => $config));
             //echo CHtml::link('View',array('/importantNotice/print_notice','id'=>$notice_id),array('id'=>'hello'));
         }
     } else {
         echo '<div id="stud_doc_id1">';
         echo '</div>';
     }
 }
 function perform()
 {
     $tree =& limb_tree::instance();
     if (isset($_REQUEST['id'])) {
         $node_id = (int) $_REQUEST['id'];
     } else {
         $node_id = get_mapped_id();
     }
     if (!isset($_REQUEST['direction'])) {
         return false;
     }
     if (!($object_data = fetch_one_by_node_id($node_id))) {
         debug::write_error('Node is not accessible', __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__, array('node_id' => $node_id));
         return false;
     }
     $direction = $_REQUEST['direction'];
     if (!($direction == 'up' || $direction == 'down')) {
         debug::write_error('Direction is not correct', __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__, array('direction' => $direction));
         return false;
     }
     if ($tree->change_node_order($node_id, $direction)) {
         reload(PHP_SELF . '#' . $node_id);
     }
     return false;
 }
예제 #6
0
	public function execute(){
		$this->title = '.htaccess Setup';
		$tpl = $this->getTemplate();

		// Try to write the file.  If I can't, display what it needs to be along with instructions.
		// Check the for the presence of the .htaccess file.  I always forget that bastard otherwise.
		if(!file_exists(ROOT_PDIR . '.htaccess')){
			$fdata = file_get_contents(ROOT_PDIR . 'htaccess.example');

			$replaces = [
				'@{rewritebase}@' => ROOT_WDIR,
				'@{build.time}@' => date('r'),
			];
			$fdata = str_replace(array_keys($replaces), array_values($replaces), $fdata);

			if(is_writable(ROOT_PDIR)){
				// Just automatically copy it over, (with the necessary tranformations).
				file_put_contents(ROOT_PDIR . '.htaccess', $fdata);
				$this->setAsPassed();
				reload();
				// :)
			}
			else{
				// Display the instructions to the user.
				$tpl->assign('contents', $fdata);
			}
		}
		else{
			$this->setAsPassed();
			reload();
		}
	}
예제 #7
0
 public function parse($orig_name)
 {
     global $CORE;
     ob_start();
     if (is_action()) {
         try {
             $name = post('name');
             if (!$name) {
                 throw new FieldInputError('name', l('Please provide a map name.'));
             }
             if (!preg_match(MATCH_MAP_NAME, $name)) {
                 throw new FieldInputError('name', l('This is not a valid map name (need to match [M])', array('M' => MATCH_MAP_NAME)));
             }
             if (count($CORE->getAvailableMaps('/^' . $name . '$/')) > 0) {
                 throw new FieldInputError('name', l('A map with this name already exists.'));
             }
             // Read the old config
             $MAPCFG = new GlobalMapCfg($orig_name);
             $MAPCFG->readMapConfig();
             // Create a new map config
             $NEW = new GlobalMapCfg($name);
             $NEW->createMapConfig();
             foreach ($MAPCFG->getMapObjects() as $object_id => $cfg) {
                 $NEW->addElement($cfg['type'], $cfg, $perm = true, $object_id);
             }
             success(l('The map has been created.'));
             reload(cfg('paths', 'htmlbase') . '/frontend/nagvis-js/index.php?mod=Map&show=' . $name, 1);
         } catch (FieldInputError $e) {
             form_error($e->field, $e->msg);
         } catch (NagVisException $e) {
             form_error(null, $e->message());
         } catch (Exception $e) {
             if (isset($e->msg)) {
                 form_error(null, $e->msg);
             } else {
                 throw $e;
             }
         }
     }
     echo $this->error;
     echo '<div class="simple_form">' . N;
     js_form_start('to_new_map');
     input('name');
     submit(l('Save'));
     focus('name');
     // Keep the view parameters the users has set
     $params = ltrim(req('view_params'), '&');
     if ($params) {
         $parts = explode('&', $params);
         foreach ($parts as $part) {
             list($key, $val) = explode('=', $part);
             hidden($key, $val);
         }
     }
     form_end();
     echo '</div>' . N;
     return ob_get_clean();
 }
 function perform()
 {
     $object =& site_object_factory::create('user_object');
     if (!$object->activate_password()) {
         message_box::write_notice('Password activation failed!');
         reload('/');
     }
     return true;
 }
예제 #9
0
파일: wyloguj.php 프로젝트: WlasnaGra/Genix
function wyloguj()
{
    //wyczyść sesję
    $_SESSION = array();
    //zakończ sesję
    session_destroy();
    //przejdź do strony głównej gry
    reload("start");
}
예제 #10
0
파일: HeroMgr.php 프로젝트: WlasnaGra/Arena
 public function spells_end($config, $player)
 {
     $events = get_all("select * from arena_events where e_type = 1 and e_usr_id = " . $player->usr_id . " and e_done = 0 and e_end <= unix_timestamp()");
     if (is_array($events)) {
         foreach ($events as $event) {
             $this->spell_dispel($config, $player, $event->e_subtype);
         }
         reload($config, 'spells', '');
     }
 }
예제 #11
0
파일: Gear.php 프로젝트: brussens/cogear2
 /**
  * Настройки
  */
 public function admin_action()
 {
     $form = new Form(array('#name' => 'admin.parser', 'title' => array('label' => t('Настройки')), 'nl2br' => array('type' => 'checkbox', 'label' => t('Автоматическая обработка строк'), 'value' => config('Parser.nl2br')), 'save' => array()));
     if ($result = $form->result()) {
         $this->set('Parser.nl2br', $result->nl2br);
         flash_success(t('Настройки сохранены!'));
         reload();
     }
     $form->show();
 }
예제 #12
0
파일: Gear.php 프로젝트: brussens/cogear2
 /**
  * Панель управления
  */
 public function admin_action()
 {
     $this->theme->hookAdminMenu();
     $form = new Form(array('#name' => 'admin.bootstrap', 'title' => array('label' => icon('wrench') . ' ' . t('Настройки')), 'theme' => array('type' => 'select', 'label' => t('Выберите тему'), 'values' => array('default' => t('Стандартная'), 'amelia' => 'Amelia', 'cerulean' => 'Cerulean', 'cosmo' => 'Cosmo', 'cyborg' => 'Cyborg', 'journal' => 'Journal', 'readable' => 'Readable', 'simplex' => 'Simplex', 'slate' => 'Slate', 'spacelab' => 'Spacelab', 'spruce' => 'Spruce', 'superhero' => 'Superhero', 'united' => 'United'), 'value' => config('bootstrap.theme', 'default')), 'save' => array()));
     if ($result = $form->result()) {
         $this->set('bootstrap.theme', $result->theme);
         flash_success(t('Настройки сохранены успешно!'));
         reload();
     }
     $form->show();
 }
 function _valid_perform()
 {
     $login = $this->_get('login');
     $password = $this->_get('password');
     $is_logged = user::login($login, $password);
     if ($is_logged) {
         $this->_process_logged_user();
         reload('/');
     } else {
         $this->_process_not_logged_user();
     }
     return $is_logged;
 }
예제 #14
0
 public function new_town($config, $player)
 {
     if ($player->actual_town == 0) {
         $is = get_one("select count(*) from towns where t_name ='" . $player->town . "'");
         if ($is == 1) {
             $player->town .= date("His");
         }
         call("\n\t\t\tinsert into towns (t_usr_id, t_name, t_nation, t_last_inc)\n\t\t\tvalue (" . $player->usr_id . ",'" . $player->town . "'," . $player->nation . ", unix_timestamp())\n\t\t\t");
         $town_id = get_one("select last_insert_id()");
         call("\n\t\t\tupdate map\n\t\t\tset m_t_id = {$town_id}\n\t\t\twhere m_t_id = 0\n\t\t\torder by rand() limit 1\n\t\t\t");
         call("\n\t\t\tupdate users\n\t\t\tset actual_town = {$town_id}\n\t\t\twhere usr_id = " . $player->usr_id);
         call("\n\t\t\tinsert into town_objects (to_t_id, to_gop_id, to_can)\n\t\t\tselect " . $town_id . ", gop_id, gop_can\n\t\t\tfrom game_objects_param\n\t\t\twhere gop_nation = " . $player->nation);
         reload($config, 'town', '');
     }
 }
예제 #15
0
/**
 *
 * @copyright  2013 izend.org
 * @version    1
 * @link       http://www.izend.org
 */
function sslverifyclient($lang, $arglist = false)
{
    global $base_url;
    if (empty($_SESSION['unverified_user'])) {
        return run('error/badrequest', $lang);
    }
    $user = $_SESSION['unverified_user'];
    unset($_SESSION['unverified_user']);
    if (empty($_SERVER['HTTPS']) or $_SERVER['HTTPS'] == 'off') {
        return run('error/unauthorized', $lang);
    }
    $_SESSION['user'] = $user;
    $next_page = !empty($arglist['r']) ? $arglist['r'] : url('home', $lang);
    return reload($base_url . $next_page);
}
예제 #16
0
function paypalcheckout($lang, $amount, $currency, $tax = 0, $context = false)
{
    global $base_url, $paypal_url, $sitename, $supported_languages;
    if (!user_is_identified()) {
        return run('error/unauthorized', $lang);
    }
    if (!(is_numeric($amount) and $amount > 0)) {
        return run('error/badrequest', $lang);
    }
    $amt = paypal_amt($amount);
    if (!validate_currency($currency)) {
        return run('error/badrequest', $lang);
    }
    $currencycode = $currency;
    if (!(is_numeric($tax) and $tax >= 0)) {
        return run('error/badrequest', $lang);
    }
    $taxamt = paypal_amt($tax);
    $itemamt = paypal_amt($amount - $tax);
    $name = translate('donate:name', $lang);
    $locale = $lang;
    if (!$locale) {
        $locale = user_profile('locale');
    }
    if (!$locale) {
        $locale = $supported_languages[0];
    }
    $localecode = paypal_localecode($locale);
    $email = user_profile('mail');
    $brandname = $sitename;
    $hdrimg = $base_url . '/logos/sitelogo.png';
    $returnurl = $base_url . url('paypalreturn', $lang);
    $cancelurl = $base_url . url('paypalcancel', $lang);
    $params = array('LOCALECODE' => $localecode, 'PAYMENTREQUEST_0_PAYMENTACTION' => 'Sale', 'PAYMENTREQUEST_0_CURRENCYCODE' => $currencycode, 'PAYMENTREQUEST_0_AMT' => $amt, 'PAYMENTREQUEST_0_ITEMAMT' => $itemamt, 'PAYMENTREQUEST_0_TAXAMT' => $taxamt, 'L_PAYMENTREQUEST_0_NAME0' => $name, 'L_PAYMENTREQUEST_0_AMT0' => $itemamt, 'L_PAYMENTREQUEST_0_TAXAMT0' => $taxamt, 'L_PAYMENTREQUEST_0_QTY0' => '1', 'NOSHIPPING' => '1', 'ALLOWNOTE' => '0', 'EMAIL' => $email, 'BRANDNAME' => $sitename, 'HDRIMG' => $hdrimg, 'RETURNURL' => $returnurl, 'CANCELURL' => $cancelurl);
    $r = paypal_setexpresscheckout($params);
    if (!$r) {
        return run('error/internalerror', $lang);
    }
    $token = $r['TOKEN'];
    $_SESSION['paypal'] = compact('token', 'amt', 'itemamt', 'taxamt', 'currencycode', 'context');
    reload($paypal_url . '/webscr&cmd=_express-checkout&token=' . $token);
}
예제 #17
0
 /**
  * Trackbacks sent
  * @return object
  */
 function procTrackbackSend()
 {
     // Yeokingeul to post numbers and shipping addresses Wanted
     $document_srl = Context::get('target_srl');
     $trackback_url = Context::get('trackback_url');
     $charset = Context::get('charset');
     if (!$document_srl || !$trackback_url || !$charset) {
         return new Object(-1, 'msg_invalid_request');
     }
     // Login Information Wanted
     $logged_info = Context::get('logged_info');
     if (!$logged_info->member_srl) {
         return new Object(-1, 'msg_not_permitted');
     }
     // Posts of the information obtained permission to come and check whether
     $oDocumentModel =& getModel('document');
     $oDocument = $oDocumentModel->getDocument($document_srl);
     if (!$oDocument->isExists() || !$oDocument->getSummary()) {
         return new Object(-1, 'msg_invalid_request');
     }
     if ($oDocument->getMemberSrl() != $logged_info->member_srl) {
         return new Object(-1, 'msg_not_permitted');
     }
     // Specify the title of the module, the current article
     $oModuleModel =& getModel('module');
     $module_info = $oModuleModel->getModuleInfoByModuleSrl($oDocument->get('module_srl'));
     Context::setBrowserTitle($module_info->browser_title);
     // Shipping yeokingeul
     $output = $this->sendTrackback($oDocument, $trackback_url, $charset);
     if ($output->toBool() && !in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) {
         global $lang;
         htmlHeader();
         alertScript($lang->success_registed);
         reload(true);
         closePopupScript();
         htmlFooter();
         Context::close();
         exit;
     }
     return $output;
 }
 protected function renderContent()
 {
     $notice;
     $id = Yii::app()->user->getState('org_id');
     if (!empty($id)) {
         $criteria = new CDbCriteria();
         $criteria->condition = "notice_organization_id = " . Yii::app()->user->getState('org_id');
         $criteria->limit = 5;
         $criteria->order = 'notice_id desc';
         $notice = ImportantNotice::model()->findAll($criteria);
         foreach ($notice as $list) {
             $imp_notice = substr($list['notice'], 0, 150) . "...";
             echo CHtml::link($imp_notice, array('/importantNotice/print_notice', 'id' => $list['notice_id']), array('id' => 'hello')) . '<br /><br />';
         }
         $config = array('scrolling' => 'no', 'autoDimensions' => false, 'width' => '500', 'height' => '100', 'overlayColor' => '#000', 'padding' => '0', 'showCloseButton' => true, 'onClose' => function () {
             return window . location . reload();
         });
         $this->widget('application.extensions.fancybox.EFancyBox', array('target' => 'a#hello', 'config' => $config));
     } else {
         echo '<div id="stud_doc_id1">';
         echo '</div>';
     }
 }
예제 #19
0
	public function execute() {
		// Some more preflight checks, such as htaccess presence and permissions.
		// See https://rm.eval.bz/issues/29 for more info.

		$tests = array(
			$this->testPHPVersion(),
			$this->testPHPMemoryLimit(),
			$this->testBCMath(),
			$this->testRewrite(),
			$this->testPHPXML(),
			$this->testPHPMcrypt(),
			$this->testMBString(),
			$this->testPHPcURL(),
			$this->testHTAccessFile(),
			$this->testConfigFile(),
			$this->testLogDirectory(),
		);

		// Run through all these checks and see if there were any errors.
		$good = true;
		foreach($tests as $test){
			if($test['status'] == 'error') $good = false;
		}

		if($good && $_SERVER['REQUEST_METHOD'] == 'POST'){
			// user clicked "next"
			// Mark this task as passed and proceed to the next.
			$this->setAsPassed();
			reload();
		}

		$tpl = $this->getTemplate();

		$this->title = 'Preflight Checks';
		$tpl->assign('tests', $tests);
		$tpl->assign('good', $good);
	}
예제 #20
0
function parse_memory()
{
    $unix = new unix();
    $nginx = $unix->find_program("nginx");
    $sock = new sockets();
    $nginx = $unix->find_program("nginx");
    if (!is_file($nginx)) {
        if ($GLOBALS["OUTPUT"]) {
            echo "Starting......: " . date("H:i:s") . " [INIT]: Nginx, not installed\n";
        }
        return;
    }
    $pidfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".pid";
    $pidtime = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".time";
    $pidStampReload = $GLOBALS["pidStampReload"];
    if (!$GLOBALS["VERBOSE"]) {
        echo "{$pidtime}\n";
        $pid = $unix->get_pid_from_file($pidfile);
        if ($unix->process_exists($pid, basename(__FILE__))) {
            $time = $unix->PROCCESS_TIME_MIN($pid);
            if ($GLOBALS["OUTPUT"]) {
                echo "Starting......: " . date("H:i:s") . " [INIT]: Nginx Already Artica task running PID {$pid} since {$time}mn\n";
            }
            return;
        }
        $TimExec = $unix->file_time_min($pidtime);
        if ($TimExec < 5) {
            return;
        }
    }
    @file_put_contents($pidfile, getmypid());
    @unlink($pidtime);
    @file_put_contents($pidtime, time());
    $python = $unix->find_program("python");
    $nice = $unix->EXEC_NICE();
    exec("{$nice}{$python} /usr/share/artica-postfix/bin/ps_mem.py 2>&1", $results);
    $FOUND = false;
    while (list($index, $line) = each($results)) {
        $line = trim($line);
        if ($line == null) {
            continue;
        }
        if (!preg_match("#^[0-9\\.]+.*?=\\s+([0-9\\.]+)\\s+(.+?)\\s+nginx#", $line, $re)) {
            if ($GLOBALS["VERBOSE"]) {
                echo "Not found \"{$line}\"\n";
            }
            continue;
        }
        $memoryValue = $re[1];
        $unit = trim(strtolower($re[2]));
        echo "Found {$memoryValue} {$unit}\n";
        if ($unit == "kib") {
            $memoryValue = $memoryValue / 1048.576;
        }
        if ($unit == "mib") {
            $memoryValue = $memoryValue * 1.048576;
        }
        if ($unit == "gib") {
            $memoryValue = $memoryValue * 1048.576;
        }
        $FOUND = true;
        break;
    }
    if (!$FOUND) {
        if ($GLOBALS["VERBOSE"]) {
            echo "Not found...\n";
        }
        return;
    }
    $memoryValue = round($memoryValue, 2);
    $MaxMemory = max_memory();
    $MaxMemoryReload = $MaxMemory / 2;
    $memoryValueInt = intval($memoryValue);
    echo "Nginx = {$memoryValue} MB  INT({$memoryValueInt}) Reload on:{$MaxMemoryReload}MB; Restart on:{$MaxMemory}MB\n";
    $ACTION_DONE = false;
    if ($MaxMemory > 0) {
        if ($memoryValueInt > 0) {
            if ($memoryValueInt > $MaxMemoryReload) {
                $StampTime = $unix->file_time_min($pidStampReload);
                if ($StampTime > 20) {
                    squid_admin_mysql(1, "Reverse proxy reach medium memory {$memoryValueInt}MB Reload:{$MaxMemoryReload}MB [action=reload]", "The service will be restarted");
                    reload(true);
                    @unlink($pidStampReload);
                    @file_put_contents($pidStampReload, time());
                    $ACTION_DONE = true;
                }
            }
            if (!$ACTION_DONE) {
                if ($memoryValueInt > $MaxMemory) {
                    squid_admin_mysql(0, "Reverse proxy reach max memory allowed {$memoryValueInt}MB MAX:{$MaxMemory}MB [action=restart]", "The service will be restarted");
                    stop(true);
                    start(true);
                    @unlink($pidStampReload);
                }
            }
        }
    }
    add_memory_value($memoryValue);
}
예제 #21
0
파일: index.php 프로젝트: WlasnaGra/HellPit
    if (!empty($_GET['set_pit'])) {
        $_GET['set_pit'] = (int) $_GET['set_pit'];
        $is = one("select pit_id from hellpit_pits where pit_id = " . $_GET['set_pit'] . " and pit_user = "******"update hellpit_users set actual_pit = " . $_GET['set_pit'] . " where user = "******"update hellpit_users set exp = exp - exp_lvl, exp_lvl = exp_lvl * 1.666, skills = skills + 3, lvl = lvl + 1 where user = " . $player->user);
        reload($_GET['x']);
    }
    $header = 'templates/user/header.php';
    $footer = 'templates/user/footer.php';
    $page = 'templates/user/' . $_GET['x'] . '.php';
} elseif (in_Array($_GET['x'], $master_act)) {
    $header = 'templates/master/header.php';
    $footer = 'templates/master/footer.php';
    $page = 'templates/master/' . $_GET['x'] . '.php';
} else {
    $header = 'templates/master/header.php';
    $footer = 'templates/master/footer.php';
    $page = 'templates/master/default.php';
}
require_once $header;
require_once $page;
예제 #22
0
if ($event === false) {
    $tmpl->renderBadLink();
    return;
}
if (!Event::isActive($db, $_GET['key'])) {
    $tmpl->renderBadLink();
    return;
}
$user_ch = $db->query('SELECT user_id, nick, email FROM users WHERE nick = ' . $db->quote($_GET['nick']))->fetch();
if ($user_ch === false) {
    $tmpl->renderBadLink();
    return;
}
if ((int) $event['user_id'] !== (int) $user_ch['user_id']) {
    $tmpl->renderBadLink();
    return;
}
$value = Event::getData($db, $_GET['key']);
if ($value === false) {
    reload('?fb=change_email_failed');
}
$db->beginTransaction();
try {
    Event::setComplete($db, $_GET['key']);
    $db->update('users', ['email' => $value], 'user_id = ' . $db->quote($user_ch['user_id']));
    $db->commit();
    reload('?fb=change_email_new_success');
} catch (\Snabb\Database\Exception $e) {
    $db->rollback();
    reload('?fb=change_email_failed');
}
예제 #23
0
파일: core.php 프로젝트: WlasnaGra/Utopia
function isAdmin($config, $player)
{
    if ($player->role != 2) {
        reload($config, 'town', '');
    }
}
예제 #24
0
 /**
  * Update a group of selected memebrs
  * @return void|Object (void : success, Object : fail)
  */
 function procMemberAdminUpdateMembersGroup()
 {
     $member_srl = Context::get('member_srl');
     if (!$member_srl) {
         return new Object(-1, 'msg_invalid_request');
     }
     $member_srls = explode(',', $member_srl);
     $group_srl = Context::get('group_srls');
     if (!is_array($group_srl)) {
         $group_srls = explode('|@|', $group_srl);
     } else {
         $group_srls = $group_srl;
     }
     $oDB =& DB::getInstance();
     $oDB->begin();
     // Delete a group of selected members
     $args = new stdClass();
     $args->member_srl = $member_srl;
     $output = executeQuery('member.deleteMembersGroup', $args);
     if (!$output->toBool()) {
         $oDB->rollback();
         return $output;
     }
     // Add to a selected group
     $group_count = count($group_srls);
     $member_count = count($member_srls);
     for ($j = 0; $j < $group_count; $j++) {
         $group_srl = (int) trim($group_srls[$j]);
         if (!$group_srl) {
             continue;
         }
         for ($i = 0; $i < $member_count; $i++) {
             $member_srl = (int) trim($member_srls[$i]);
             if (!$member_srl) {
                 continue;
             }
             $args = new stdClass();
             $args->member_srl = $member_srl;
             $args->group_srl = $group_srl;
             $output = executeQuery('member.addMemberToGroup', $args);
             if (!$output->toBool()) {
                 $oDB->rollback();
                 return $output;
             }
         }
     }
     $oDB->commit();
     $this->_deleteMemberGroupCache();
     $this->setMessage('success_updated');
     if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) {
         global $lang;
         htmlHeader();
         alertScript($lang->success_updated);
         reload(true);
         closePopupScript();
         htmlFooter();
         Context::close();
         exit;
     }
 }
예제 #25
0
 /**
  * layout copy
  * @return void
  */
 function procLayoutAdminCopyLayout()
 {
     $sourceArgs = Context::getRequestVars();
     if ($sourceArgs->layout == 'faceoff') {
         return $this->stop('not supported');
     }
     if (!$sourceArgs->layout_srl) {
         return $this->stop('msg_empty_origin_layout');
     }
     $oLayoutModel = getModel('layout');
     $layout = $oLayoutModel->getLayout($sourceArgs->layout_srl);
     if (!$sourceArgs->title) {
         $sourceArgs->title = array($layout->title . '_' . $this->_makeRandomMid());
     }
     if (!is_array($sourceArgs->title) || count($sourceArgs->title) == 0) {
         return $this->stop('msg_empty_target_layout');
     }
     $output = $oLayoutModel->getLayoutRawData($sourceArgs->layout_srl, array('extra_vars'));
     $args = new stdClass();
     $args->extra_vars = $output->extra_vars;
     $extra_vars = unserialize($args->extra_vars);
     if ($layout->extra_var_count) {
         $reg = "/^.\\/files\\/attach\\/images\\/([0-9]+)\\/(.*)/";
         if ($extra_vars) {
             foreach ($extra_vars as $key => $val) {
                 if ($layout->extra_var->{$key}->type == 'image') {
                     if (!preg_match($reg, $val, $matches)) {
                         continue;
                     }
                     $image_list[$key]->filename = $matches[2];
                     $image_list[$key]->old_file = $val;
                 }
             }
         }
     }
     $oModuleController = getController('module');
     $layout_config = new stdClass();
     $layout_config->header_script = $extra_vars->header_script;
     // Get information to create a layout
     $args->site_srl = (int) $layout->site_srl;
     $args->layout = $layout->layout;
     $args->layout_type = $layout->layout_type;
     if (!$args->layout_type) {
         $args->layout_type = "P";
     }
     $oDB =& DB::getInstance();
     $oDB->begin();
     if (is_array($sourceArgs->title)) {
         foreach ($sourceArgs->title as $key => $value) {
             if (!trim($value)) {
                 continue;
             }
             $args->layout_srl = getNextSequence();
             $args->title = $value;
             if (is_array($image_list)) {
                 foreach ($image_list as $key => $val) {
                     $new_file = sprintf("./files/attach/images/%s/%s", $args->layout_srl, $val->filename);
                     FileHandler::copyFile($val->old_file, $new_file);
                     $extra_vars->{$key} = $new_file;
                 }
                 $args->extra_vars = serialize($extra_vars);
             }
             // for header script
             $oModuleController->insertModulePartConfig('layout', $args->layout_srl, $layout_config);
             // Insert into the DB
             $output = $this->insertLayout($args);
             if (!$output->toBool()) {
                 $oDB->rollback();
                 return $output;
             }
             // initiate if it is faceoff layout
             $this->initLayout($args->layout_srl, $args->layout);
             // update layout info
             $output = $this->updateLayout($args);
             if (!$output->toBool()) {
                 $oDB->rollback();
                 return $output;
             }
             $this->_copyLayoutFile($layout->layout_srl, $args->layout_srl);
         }
     }
     $oDB->commit();
     $this->setMessage('success_registed');
     if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) {
         global $lang;
         htmlHeader();
         alertScript($lang->success_registed);
         reload(true);
         closePopupScript();
         htmlFooter();
         Context::close();
         exit;
     }
 }
예제 #26
0
<?php 
$this->widget('zii.widgets.grid.CGridView', array('id' => 'student-academic-record-trans-grid', 'dataProvider' => $studentfeedback->mysearch(), 'enableSorting' => false, 'columns' => array(array('header' => 'SN.', 'class' => 'IndexColumn'), array('name' => 'feedback_category_master_id', 'value' => 'FeedbackCategoryMaster::model()->findByPk($data->feedback_category_master_id)->feedback_category_name'), 'feedback_details_remarks', array('class' => 'CButtonColumn', 'template' => '{update}{delete}', 'buttons' => array('view' => array('url' => 'Yii::app()->createUrl("feedbackDetailsTable/view", array("id"=>$data->feedback_details_table_id))'), 'update' => array('url' => 'Yii::app()->createUrl("feedbackDetailsTable/update", array("id"=>$data->feedback_details_table_id))', 'options' => array('id' => 'update-feedback')), 'delete' => array('url' => 'Yii::app()->createUrl("feedbackDetailsTable/delete", array("id"=>$data->feedback_details_table_id))'))))));
?>
</div>


<?php 
$config = array('scrolling' => 'no', 'autoDimensions' => false, 'width' => '715', 'height' => '280', 'titleShow' => false, 'overlayColor' => '#000', 'padding' => '0', 'showCloseButton' => true, 'onClose' => function () {
    return window . location . reload();
});
$this->widget('application.extensions.fancybox.EFancyBox', array('target' => '#stud_doc_id', 'config' => $config));
$config = array('scrolling' => 'no', 'autoDimensions' => false, 'width' => '755', 'height' => '420', 'titleShow' => false, 'overlayColor' => '#000', 'padding' => '0', 'showCloseButton' => true, 'onClose' => function () {
    return window . location . reload();
});
$this->widget('application.extensions.fancybox.EFancyBox', array('target' => '#stud_doc_id1', 'config' => $config));
$this->widget('application.extensions.fancybox.EFancyBox', array('target' => '#stud_feedback', 'config' => $config));
$config = array('scrolling' => 'no', 'autoDimensions' => false, 'width' => '755', 'height' => '250', 'titleShow' => false, 'overlayColor' => '#000', 'padding' => '0', 'showCloseButton' => true, 'onClose' => function () {
    return window . location . reload();
});
$this->widget('application.extensions.fancybox.EFancyBox', array('target' => '#stud_feedback', 'config' => $config));
?>

<?php 
$config = array('scrolling' => 'no', 'autoDimensions' => false, 'width' => '755', 'height' => '420', 'titleShow' => false, 'overlayColor' => '#000', 'padding' => '0', 'showCloseButton' => true, 'onClose' => function () {
    return window . location . reload();
});
$this->widget('application.extensions.fancybox.EFancyBox', array('target' => 'a#update-qualification', 'config' => $config));
$config = array('scrolling' => 'no', 'autoDimensions' => false, 'width' => '755', 'height' => '250', 'titleShow' => false, 'overlayColor' => '#000', 'padding' => '0', 'showCloseButton' => true, 'onClose' => function () {
    return window . location . reload();
});
$this->widget('application.extensions.fancybox.EFancyBox', array('target' => 'a#update-feedback', 'config' => $config));
예제 #27
0
 /**
  * Refund Payment
  */
 function refund()
 {
     // Capture payment
     if (!$this->get['payment']->refund()) {
         // There was an error processing the transaction
         throw new SWUserException("[CC_TRANSACTION_FAILED]");
     }
     if ($this->get['payment']->getStatus() == "Declined") {
         // Transaction was declined
         throw new SWUserException("[CC_REFUND_DECLINED]");
     }
     // Update the payment record
     update_PaymentDBO($this->get['payment']);
     // Success
     $this->setMessage(array("type" => "[CC_REFUNDED]"));
     $this - reload();
 }
예제 #28
0
파일: Gear.php 프로젝트: brussens/cogear2
 /**
  * Show admin page
  */
 public function admin_action($action = 'list')
 {
     $this->hookAdminMenu();
     switch ($action) {
         case 'settings':
             $form = new Form(array('#name' => 'user.admin.settings', 'title' => array('label' => icon('user') . ' ' . t('Настройки регистрации')), 'registration' => array('type' => 'checkbox', 'value' => config('user.register.active'), 'label' => t('Регистрация разрешена')), 'verification' => array('type' => 'checkbox', 'value' => config('user.register.verification'), 'label' => t('Подтверждение регистрации по электронной почте')), 'save' => array()));
             if ($result = $form->result()) {
                 $this->set('user.register.active', $result->registration);
                 $this->set('user.register.verification', $result->verification);
                 flash_success('Настройки сохранены!');
                 reload();
             }
             $form->show();
             break;
         default:
             $q = $this->input->get('q');
             $tpl = new Template('Search/templates/form');
             $tpl->action = l('/admin/users/');
             $q && ($tpl->value = $q);
             $tpl->show('info');
             Db_ORM::skipClear();
             $list = new User_List(array('name' => 'admin.users', 'base' => l('/admin/user/'), 'per_page' => config('Admin.user.per_page', 20), 'render' => FALSE));
             $fields = $list->getFields();
             $list->setFields($fields);
             $list->show();
     }
 }
예제 #29
0
    stop();
    die;
}
if ($argv[1] == "--start") {
    $GLOBALS["OUTPUT"] = true;
    start();
    die;
}
if ($argv[1] == "--restart") {
    $GLOBALS["OUTPUT"] = true;
    restart();
    die;
}
if ($argv[1] == "--reload") {
    $GLOBALS["OUTPUT"] = true;
    reload();
    die;
}
if ($argv[1] == "--build") {
    $GLOBALS["OUTPUT"] = true;
    build();
    die;
}
if ($argv[1] == "--clean") {
    $GLOBALS["OUTPUT"] = true;
    cleanstorage();
    die;
}
$GLOBALS["OUTPUT"] = true;
xstart();
function build_progress($text, $pourc)
예제 #30
0
                    if ($tag_id === false) {
                        $db->insert('tags', ['tag' => $tag, 'list_id' => $_GET['id']]);
                        $tag_id = $db->query('SELECT tag_id FROM tags WHERE list_id  = ' . $db->quote($_GET['id']) . ' and tag = ' . $db->quote($tag))->fetch();
                        $db->insert('task_tags', ['tag_id' => $tag_id['tag_id'], 'task_id' => $task_id['task_id']]);
                    } else {
                        $db->insert('task_tags', ['tag_id' => $tag_id['tag_id'], 'task_id' => $task_id['task_id']]);
                    }
                }
            }
            if ($user_assigment_ids) {
                foreach ($user_assigment_ids as $user_id) {
                    $db->insert('tasks_assignment', ['task_id' => $task_id['task_id'], 'user_id' => $user_id, 'assigned_by' => $user->user_id, 'assign_date' => time()]);
                }
            }
            $db->commit();
            reload('list?id=' . (int) $_GET['id'] . '&fb=task_add_success');
        } catch (\Snabb\Database\Exception $e) {
            $db->rollback();
            $toSelect = ['title', 'description', 'priority', 'due_date', 'tags'];
            if ($user_assigment_ids) {
                $toSelect[] = 'user_assignments';
            }
            $tmpl->assign(\Snabb\Tools\Arrays::selective_keys($_POST, $toSelect));
            $tmpl->addMessage('Přidání úkolu se nezdařilo.', Template::MESSAGE_ERROR);
        }
    }
}
$tmpl->assign(['submit' => 'Přidat', 'pageHeading' => 'Přidání úkolu do listu', 'list_assigments' => $list_assigments, 'current_menu_list' => (int) $_GET['id']]);
$tmpl->renderTop('Přidání úkolu do listu', $user);
$tmpl->render('forms/task_add.tpl');
$tmpl->renderBottom();