Example #1
0
function ShowTeamspeakPage()
{
    global $LNG;
    $config = Config::get(Universe::getEmulated());
    if ($_POST) {
        $config_before = array('ts_timeout' => $config->ts_timeout, 'ts_modon' => $config->ts_modon, 'ts_server' => $config->ts_server, 'ts_tcpport' => $config->ts_tcpport, 'ts_udpport' => $config->ts_udpport, 'ts_version' => $config->ts_version, 'ts_login' => $config->ts_login, 'ts_password' => $config->ts_password, 'ts_cron_interval' => $config->ts_cron_interval);
        $ts_modon = isset($_POST['ts_on']) && $_POST['ts_on'] == 'on' ? 1 : 0;
        $ts_server = HTTP::_GP('ts_ip', '');
        $ts_tcpport = HTTP::_GP('ts_tcp', 0);
        $ts_udpport = HTTP::_GP('ts_udp', 0);
        $ts_timeout = HTTP::_GP('ts_to', 0);
        $ts_version = HTTP::_GP('ts_v', 0);
        $ts_login = HTTP::_GP('ts_login', '');
        $ts_password = HTTP::_GP('ts_password', '', true);
        $ts_cron_interval = HTTP::_GP('ts_cron', 0);
        $config_after = array('ts_timeout' => $ts_timeout, 'ts_modon' => $ts_modon, 'ts_server' => $ts_server, 'ts_tcpport' => $ts_tcpport, 'ts_udpport' => $ts_udpport, 'ts_version' => $ts_version, 'ts_login' => $ts_login, 'ts_password' => $ts_password, 'ts_cron_interval' => $ts_cron_interval);
        foreach ($config_after as $key => $value) {
            $config->{$key} = $value;
        }
        $config->save();
        $sql = "UPDATE %%CRONJOBS%%\n\t\tSET isActive = :isActive, `lock` = NULL, nextTime = 0\n\t\tWHERE name = 'teamspeak';";
        Database::get()->update($sql, array(':isActive' => $ts_modon));
        $LOG = new Log(3);
        $LOG->target = 4;
        $LOG->old = $config_before;
        $LOG->new = $config_after;
        $LOG->save();
    }
    $template = new template();
    $template->assign_vars(array('se_save_parameters' => $LNG['se_save_parameters'], 'ts_tcpport' => $LNG['ts_tcpport'], 'ts_serverip' => $LNG['ts_serverip'], 'ts_version' => $LNG['ts_version'], 'ts_active' => $LNG['ts_active'], 'ts_settings' => $LNG['ts_settings'], 'ts_udpport' => $LNG['ts_udpport'], 'ts_timeout' => $LNG['ts_timeout'], 'ts_server_query' => $LNG['ts_server_query'], 'ts_sq_login' => $LNG['ts_login'], 'ts_sq_pass' => $LNG['ts_pass'], 'ts_lng_cron' => $LNG['ts_cron'], 'ts_to' => $config->ts_timeout, 'ts_on' => $config->ts_modon, 'ts_ip' => $config->ts_server, 'ts_tcp' => $config->ts_tcpport, 'ts_udp' => $config->ts_udpport, 'ts_v' => $config->ts_version, 'ts_login' => $config->ts_login, 'ts_password' => $config->ts_password, 'ts_cron' => $config->ts_cron_interval));
    $template->show('TeamspeakPage.tpl');
}
 function get_setting()
 {
     $payconf = M('redcash_wxconf')->where(array('token' => $this->token))->find();
     if (!$payconf['mchid'] || !$payconf['appid'] || !$payconf['key']) {
         Log::record('get red cash wechat params: ' . print_r($payconf, 1), Log::INFO);
         Log::save();
         die('微信参数配置不完整');
     }
     $setting = M('redcash_setting')->where(array('token' => $this->token, 'id' => $this->redcash_id))->find();
     $setting['mchid'] = $payconf['mchid'];
     $setting['appid'] = $payconf['appid'];
     $setting['key'] = $payconf['key'];
     if ($setting['status'] == '1') {
         $money = intval($setting['fixed_amount'] * 100);
         $setting['min_value'] = $money;
         $setting['max_value'] = $money;
         $setting['total_amount'] = $money;
     }
     if (!$setting['nick_name'] || !$setting['send_name'] || !$setting['fixed_amount'] || !$setting['wishing'] || !$setting['act_name'] || !$setting['remark']) {
         Log::record('get red cash params : ' . print_r($setting, 1), Log::INFO);
         Log::save();
         die('活动信息配置不完整');
     }
     $certs = array('SSLCERT' => getcwd() . '/' . $payconf['ssl_cert'], 'SSLKEY' => getcwd() . '/' . $payconf['ssl_key'], 'CAINFO' => getcwd() . '/' . $payconf['ssl_cainfo']);
     if (!$certs) {
         die('未设置微信支付证书信息');
     }
     $setting['certs'] = array('certs' => $certs);
     return $setting;
 }
Example #3
0
 /**
  * @param sfWebRequest $request
  * @return string
  */
 public function executeDecisionModalSave(sfWebRequest $request)
 {
     $decision_id = $this->getUser()->getAttribute('decision_id', null, 'sfGuardSecurityUser');
     if (!empty($decision_id)) {
         $decision = DecisionTable::getInstance()->getDecisionForUser($this->getUser()->getGuardUser(), $decision_id);
     }
     if (empty($decision) || !is_object($decision)) {
         if (!DecisionTable::getInstance()->verifyAvailableName($this->getUser()->getGuardUser(), $request->getParameter('name'))) {
             return $this->renderText(json_encode(array('status' => 'error', 'message' => 'A project with that name already exists')));
         }
         $decision = new Decision();
         $folder = FolderTable::getInstance()->getNotDeletableForUser($this->getUser()->getGuardUser(), Folder::TYPE_PROJECT);
         if (!empty($folder)) {
             $decision->setFolderId($folder->getId());
         }
         // Create log
         $log = new Log();
         $log->setAction('project_create');
         $log->setUserId($this->getUser()->getGuardUser()->id);
         $log->setInformation(json_encode(array('decision_name' => $request->getParameter('name'), 'decision_type' => $request->getParameter('type_id'), 'decision_template' => $request->getParameter('template_id'))));
         $log->save();
     }
     $decision->setName($request->getParameter('name', ''));
     $decision->setTypeId($request->getParameter('type_id'));
     $decision->setTemplateId($request->getParameter('template_id'));
     $decision->save();
     $this->getUser()->setAttribute('decision_id', $decision->getId(), 'sfGuardSecurityUser');
     return $this->renderText(json_encode(array('status' => 'success', 'dashboard_url' => $this->generateUrl('dashboard', array('decision_id' => $decision->getId())))));
 }
Example #4
0
 /**
 +----------------------------------------------------------
 * 应用程序初始化
 +----------------------------------------------------------
 * @access public
 +----------------------------------------------------------
 * @return void
 +----------------------------------------------------------
 */
 public static function run()
 {
     // 设定错误和异常处理
     set_error_handler(array('App', "appError"));
     set_exception_handler(array('App', "appException"));
     //[RUNTIME]
     // 检查项目是否编译过
     // 在部署模式下会自动在第一次执行的时候编译项目
     if (defined('RUNTIME_MODEL')) {
         // 运行模式无需载入项目编译缓存
     } elseif (is_file(RUNTIME_PATH . '~app.php')) {
         // 直接读取编译后的项目文件
         C(include RUNTIME_PATH . '~app.php');
     } else {
         // 预编译项目
         App::build();
     }
     //[/RUNTIME]
     // 取得模块和操作名称
     define('MODULE_NAME', isset($_SERVER['argv'][1]) ? $_SERVER['argv'][1] : C('DEFAULT_MODULE'));
     define('ACTION_NAME', isset($_SERVER['argv'][2]) ? $_SERVER['argv'][2] : C('DEFAULT_ACTION'));
     // 执行操作
     R(MODULE_NAME, ACTION_NAME);
     // 保存日志记录
     if (C('LOG_RECORD')) {
         Log::save();
     }
     return;
 }
 /**
 +----------------------------------------------------------
 * 应用程序初始化
 +----------------------------------------------------------
 * @access public
 +----------------------------------------------------------
 * @return void
 +----------------------------------------------------------
 */
 public static function run()
 {
     //导入类库
     Vendor('phpRPC.phprpc_server');
     //实例化phprpc
     $server = new PHPRPC_Server();
     $actions = explode(',', C('APP_PHPRPC_ACTIONS'));
     foreach ($actions as $action) {
         //$server -> setClass($action.'Action');
         $temp = $action . 'Action';
         $methods = get_class_methods($temp);
         $server->add($methods, new $temp());
     }
     if (APP_DEBUG) {
         $server->setDebugMode(true);
     }
     $server->setEnableGZIP(true);
     $server->start();
     //C('PHPRPC_COMMENT',$server->comment());
     echo $server->comment();
     // 保存日志记录
     if (C('LOG_RECORD')) {
         Log::save();
     }
     return;
 }
Example #6
0
 /**
  * 运行应用实例 入口文件使用的快捷方法
  * @access public
  * @return void
  */
 public static function run()
 {
     // 设置系统时区
     date_default_timezone_set(C('DEFAULT_TIMEZONE'));
     // 加载动态项目公共文件和配置
     load_ext_file();
     // 项目初始化标签
     tag('app_init');
     // URL调度
     Dispatcher::dispatch();
     // 项目开始标签
     tag('app_begin');
     // Session初始化 支持其他客户端
     if (isset($_REQUEST[C("VAR_SESSION_ID")])) {
         session_id($_REQUEST[C("VAR_SESSION_ID")]);
     }
     if (C('SESSION_AUTO_START')) {
         session_start();
     }
     // 记录应用初始化时间
     if (C('SHOW_RUN_TIME')) {
         G('initTime');
     }
     App::exec();
     // 项目结束标签
     tag('app_end');
     // 保存日志记录
     if (C('LOG_RECORD')) {
         Log::save();
     }
     return;
 }
Example #7
0
function ShowDisclamerPage()
{
    global $LNG;
    $config = Config::get(Universe::getEmulated());
    if (!empty($_POST)) {
        $config_before = array('disclamerAddress' => $config->disclamerAddress, 'disclamerPhone' => $config->disclamerPhone, 'disclamerMail' => $config->disclamerMail, 'disclamerNotice' => $config->disclamerNotice);
        $disclaimerAddress = HTTP::_GP('disclaimerAddress', '', true);
        $disclaimerPhone = HTTP::_GP('disclaimerPhone', '', true);
        $disclaimerMail = HTTP::_GP('disclaimerMail', '', true);
        $disclaimerNotice = HTTP::_GP('disclaimerNotice', '', true);
        $config_after = array('disclamerAddress' => $disclaimerAddress, 'disclamerPhone' => $disclaimerPhone, 'disclamerMail' => $disclaimerMail, 'disclamerNotice' => $disclaimerNotice);
        foreach ($config_after as $key => $value) {
            $config->{$key} = $value;
        }
        $config->save();
        $LOG = new Log(3);
        $LOG->target = 5;
        $LOG->old = $config_before;
        $LOG->new = $config_after;
        $LOG->save();
    }
    $template = new template();
    $template->loadscript('../base/jquery.autosize-min.js');
    $template->execscript('$(\'textarea\').autosize();');
    $template->assign_vars(array('disclaimerAddress' => $config->disclamerAddress, 'disclaimerPhone' => $config->disclamerPhone, 'disclaimerMail' => $config->disclamerMail, 'disclaimerNotice' => $config->disclamerNotice, 'se_server_parameters' => $LNG['mu_disclaimer'], 'se_save_parameters' => $LNG['se_save_parameters'], 'se_disclaimerAddress' => $LNG['se_disclaimerAddress'], 'se_disclaimerPhone' => $LNG['se_disclaimerPhone'], 'se_disclaimerMail' => $LNG['se_disclaimerMail'], 'se_disclaimerNotice' => $LNG['se_disclaimerNotice']));
    $template->show('DisclamerConfigBody.tpl');
}
Example #8
0
 /**
  * 
  * Faz log de uma ação do usuário
  * @param string $message
  */
 public static function log($message)
 {
     $log = new Log();
     $log->cod_pessoa = Yii::app()->user->getId();
     $log->mensagem = $message;
     $log->save();
 }
function ShowChatConfigPage()
{
    global $LNG, $USER;
    $CONF = Config::getAll(NULL, 1);
    if (!empty($_POST)) {
        $config_before = array('chat_closed' => $CONF['chat_closed'], 'chat_allowchan' => $CONF['chat_allowchan'], 'chat_allowmes' => $CONF['chat_allowmes'], 'chat_allowdelmes' => $CONF['chat_allowdelmes'], 'chat_logmessage' => $CONF['chat_logmessage'], 'chat_nickchange' => $CONF['chat_nickchange'], 'chat_botname' => $CONF['chat_botname'], 'chat_channelname' => $CONF['chat_channelname']);
        $chat_allowchan = isset($_POST['chat_allowchan']) && $_POST['chat_allowchan'] == 'on' ? 1 : 0;
        $chat_allowmes = isset($_POST['chat_allowmes']) && $_POST['chat_allowmes'] == 'on' ? 1 : 0;
        $chat_allowdelmes = isset($_POST['chat_allowdelmes']) && $_POST['chat_allowdelmes'] == 'on' ? 1 : 0;
        $chat_logmessage = isset($_POST['chat_logmessage']) && $_POST['chat_logmessage'] == 'on' ? 1 : 0;
        $chat_nickchange = isset($_POST['chat_nickchange']) && $_POST['chat_nickchange'] == 'on' ? 1 : 0;
        $chat_closed = isset($_POST['chat_closed']) && $_POST['chat_closed'] == 'on' ? 1 : 0;
        $chat_channelname = HTTP::_GP('chat_channelname', '', true);
        $chat_botname = HTTP::_GP('chat_botname', '', true);
        $config_after = array('chat_closed' => $chat_closed, 'chat_allowchan' => $chat_allowchan, 'chat_allowmes' => $chat_allowmes, 'chat_allowdelmes' => $chat_allowdelmes, 'chat_logmessage' => $chat_logmessage, 'chat_nickchange' => $chat_nickchange, 'chat_botname' => $chat_botname, 'chat_channelname' => $chat_channelname);
        Config::update($config_after);
        $CONF = Config::getAll(NULL, 1);
        $LOG = new Log(3);
        $LOG->target = 3;
        $LOG->old = $config_before;
        $LOG->new = $config_after;
        $LOG->save();
    }
    $template = new template();
    $template->assign_vars(array('chat_closed' => $CONF['chat_closed'], 'chat_allowchan' => $CONF['chat_allowchan'], 'chat_allowmes' => $CONF['chat_allowmes'], 'chat_logmessage' => $CONF['chat_logmessage'], 'chat_nickchange' => $CONF['chat_nickchange'], 'chat_botname' => $CONF['chat_botname'], 'chat_channelname' => $CONF['chat_channelname'], 'se_server_parameters' => $LNG['se_server_parameters'], 'se_save_parameters' => $LNG['se_save_parameters'], 'ch_closed' => $LNG['ch_closed'], 'ch_allowchan' => $LNG['ch_allowchan'], 'ch_allowmes' => $LNG['ch_allowmes'], 'ch_allowdelmes' => $LNG['ch_allowdelmes'], 'ch_logmessage' => $LNG['ch_logmessage'], 'ch_nickchange' => $LNG['ch_nickchange'], 'ch_botname' => $LNG['ch_botname'], 'ch_channelname' => $LNG['ch_channelname']));
    $template->show('ChatConfigBody.tpl');
}
Example #10
0
 /**
  * 运行控制器
  * @access public
  * @return void
  */
 public static function run()
 {
     App::init();
     //检查服务器是否开启了zlib拓展
     if (C('GZIP_OPEN') && extension_loaded('zlib') && function_exists('ob_gzhandler')) {
         ob_end_clean();
         ob_start('ob_gzhandler');
     }
     //API控制器
     if (APP_NAME == 'api') {
         App::execApi();
         //Widget控制器
     } elseif (APP_NAME == 'widget') {
         App::execWidget();
         //Plugin控制器
     } elseif (APP_NAME == 'plugin') {
         App::execPlugin();
         //APP控制器
     } else {
         App::execApp();
     }
     //输出buffer中的内容,即压缩后的css文件
     if (C('GZIP_OPEN') && extension_loaded('zlib') && function_exists('ob_gzhandler')) {
         ob_end_flush();
     }
     if (C('LOG_RECORD')) {
         Log::save();
     }
     return;
 }
Example #11
0
 /**
 +----------------------------------------------------------
 * 应用程序初始化
 +----------------------------------------------------------
 * @access public
 +----------------------------------------------------------
 * @return void
 +----------------------------------------------------------
 */
 public static function run()
 {
     // 设定错误和异常处理
     set_error_handler(array('App', "appError"));
     set_exception_handler(array('App', "appException"));
     //[RUNTIME]
     // 检查项目是否编译过
     // 在部署模式下会自动在第一次执行的时候编译项目
     if (defined('RUNTIME_MODEL')) {
         // 运行模式无需载入项目编译缓存
     } elseif (is_file(RUNTIME_PATH . '~app.php') && (!is_file(CONFIG_PATH . 'config.php') || filemtime(RUNTIME_PATH . '~app.php') > filemtime(CONFIG_PATH . 'config.php'))) {
         // 直接读取编译后的项目文件
         C(include RUNTIME_PATH . '~app.php');
     } else {
         // 预编译项目
         App::build();
     }
     //[/RUNTIME]
     //导入类库
     Vendor('Zend.Amf.Server');
     //实例化AMF
     $server = new Zend_Amf_Server();
     $actions = explode(',', C('APP_AMF_ACTIONS'));
     foreach ($actions as $action) {
         $server->setClass($action . 'Action');
     }
     echo $server->handle();
     // 保存日志记录
     if (C('LOG_RECORD')) {
         Log::save();
     }
     return;
 }
Example #12
0
 /**
 +----------------------------------------------------------
 * 应用程序初始化
 +----------------------------------------------------------
 * @access public
 +----------------------------------------------------------
 * @return void
 +----------------------------------------------------------
 */
 public static function run()
 {
     // 设定错误和异常处理
     set_error_handler(array('App', "appError"));
     set_exception_handler(array('App', "appException"));
     //[RUNTIME]
     // 检查项目是否编译过
     // 在部署模式下会自动在第一次执行的时候编译项目
     if (defined('RUNTIME_MODEL')) {
         // 运行模式无需载入项目编译缓存
     } elseif (is_file(RUNTIME_PATH . '~app.php') && (!is_file(CONFIG_PATH . 'config.php') || filemtime(RUNTIME_PATH . '~app.php') > filemtime(CONFIG_PATH . 'config.php'))) {
         // 直接读取编译后的项目文件
         C(include RUNTIME_PATH . '~app.php');
     } else {
         // 预编译项目
         App::build();
     }
     //[/RUNTIME]
     // 取得模块和操作名称
     define('MODULE_NAME', App::getModule());
     // Module名称
     define('ACTION_NAME', App::getAction());
     // Action操作
     // 记录应用初始化时间
     if (C('SHOW_RUN_TIME')) {
         $GLOBALS['_initTime'] = microtime(TRUE);
     }
     // 执行操作
     R(MODULE_NAME, ACTION_NAME);
     // 保存日志记录
     if (C('LOG_RECORD')) {
         Log::save();
     }
     return;
 }
Example #13
0
function ShowPaybonusPage()
{
    global $LNG;
    $CONF = Config::getAll(NULL, 1);
    if (!empty($_POST)) {
        $pay_before = array('bonus_button' => $CONF['bonus_button'], 'academy_bonus' => $CONF['academy_bonus'], 'premium' => $CONF['premium'], 'stardust_bonus' => $CONF['stardust_bonus'], 'purchase_bonus' => $CONF['purchase_bonus'], 'purchase_bonus_timer' => $CONF['purchase_bonus_timer'], 'cosmonaute' => $CONF['cosmonaute'], 'fleetconf' => $CONF['fleetconf'], 'new_year' => $CONF['new_year']);
        $purchase_bonus = $_POST['percent'];
        $academy_bonus = $_POST['academy_bonus'];
        $bonus_button = $_POST['bonus_button'];
        $premium = $_POST['premium'];
        $stardust_bonus = $_POST['stardust_bonus'];
        $stardust_bonus = $_POST['stardust_bonus'];
        $fleetconf = isset($_POST['fleetconf']) && $_POST['fleetconf'] == 'on' ? 1 : 0;
        $cosmonaute = isset($_POST['cosmonaute']) && $_POST['cosmonaute'] == 'on' ? 1 : 0;
        $new_year = isset($_POST['new_year']) && $_POST['new_year'] == 'on' ? 1 : 0;
        $purchase_bonus_timer = TIMESTAMP + $_POST['days'] * 24 * 60 * 60;
        $pay_after = array('bonus_button' => $bonus_button, 'academy_bonus' => $academy_bonus, 'premium' => $premium, 'stardust_bonus' => $stardust_bonus, 'purchase_bonus' => $purchase_bonus, 'purchase_bonus_timer' => $purchase_bonus_timer, 'fleetconf' => $fleetconf, 'cosmonaute' => $cosmonaute, 'new_year' => $new_year);
        Config::update($pay_after, 1);
        $CONF = Config::getAll(NULL, 1);
        $LOG = new Log(3);
        $LOG->target = 1;
        $LOG->old = $pay_before;
        $LOG->new = $pay_after;
        $LOG->save();
    }
    $template = new template();
    $template->assign_vars(array('academy_bonus' => $CONF['academy_bonus'], 'cosmonaute' => $CONF['cosmonaute'], 'new_year' => $CONF['new_year'], 'bonus_button' => $CONF['bonus_button'], 'fleetconf' => $CONF['fleetconf'], 'premium' => $CONF['premium'], 'stardust_bonus' => $CONF['stardust_bonus'], 'purchase_bonus' => $CONF['purchase_bonus'], 'purchase_bonus_timer' => $CONF['purchase_bonus_timer'], 'bonus_next_active' => $CONF['purchase_bonus_timer'] > TIMESTAMP ? $CONF['purchase_bonus_timer'] - TIMESTAMP : 0, 'bonus_next_active_timer' => $CONF['purchase_bonus_timer'] > TIMESTAMP ? date("d.m.Y H:i:s", $CONF['purchase_bonus_timer']) : 0));
    $template->show('paybonus.tpl');
}
Example #14
0
function ShowTeamspeakPage()
{
    global $LNG, $USER;
    $CONF = Config::getAll(NULL, $_SESSION['adminuni']);
    if ($_POST) {
        $config_before = array('ts_timeout' => $CONF['ts_timeout'], 'ts_modon' => $CONF['ts_modon'], 'ts_server' => $CONF['ts_server'], 'ts_tcpport' => $CONF['ts_tcpport'], 'ts_udpport' => $CONF['ts_udpport'], 'ts_version' => $CONF['ts_version'], 'ts_login' => $CONF['ts_login'], 'ts_password' => $CONF['ts_password'], 'ts_cron_interval' => $CONF['ts_cron_interval']);
        $ts_modon = isset($_POST['ts_on']) && $_POST['ts_on'] == 'on' ? 1 : 0;
        $ts_server = HTTP::_GP('ts_ip', '');
        $ts_tcpport = HTTP::_GP('ts_tcp', 0);
        $ts_udpport = HTTP::_GP('ts_udp', 0);
        $ts_timeout = HTTP::_GP('ts_to', 0);
        $ts_version = HTTP::_GP('ts_v', 0);
        $ts_login = HTTP::_GP('ts_login', '');
        $ts_password = HTTP::_GP('ts_password', '', true);
        $ts_cron_interval = HTTP::_GP('ts_cron', 0);
        $config_after = array('ts_timeout' => $ts_timeout, 'ts_modon' => $ts_modon, 'ts_server' => $ts_server, 'ts_tcpport' => $ts_tcpport, 'ts_udpport' => $ts_udpport, 'ts_version' => $ts_version, 'ts_login' => $ts_login, 'ts_password' => $ts_password, 'ts_cron_interval' => $ts_cron_interval);
        Config::update($config_after);
        $GLOBALS['DATABASE']->query("UPDATE " . CRONJOBS . " SET isActive = " . $ts_modon . ", `lock` = NULL, nextTime = 0 WHERE name = 'teamspeak';");
        $CONF = Config::getAll(NULL, $_SESSION['adminuni']);
        $LOG = new Log(3);
        $LOG->target = 4;
        $LOG->old = $config_before;
        $LOG->new = $config_after;
        $LOG->save();
    }
    $template = new template();
    $template->assign_vars(array('se_save_parameters' => $LNG['se_save_parameters'], 'ts_tcpport' => $LNG['ts_tcpport'], 'ts_serverip' => $LNG['ts_serverip'], 'ts_version' => $LNG['ts_version'], 'ts_active' => $LNG['ts_active'], 'ts_settings' => $LNG['ts_settings'], 'ts_udpport' => $LNG['ts_udpport'], 'ts_timeout' => $LNG['ts_timeout'], 'ts_server_query' => $LNG['ts_server_query'], 'ts_sq_login' => $LNG['ts_login'], 'ts_sq_pass' => $LNG['ts_pass'], 'ts_lng_cron' => $LNG['ts_cron'], 'ts_to' => $CONF['ts_timeout'], 'ts_on' => $CONF['ts_modon'], 'ts_ip' => $CONF['ts_server'], 'ts_tcp' => $CONF['ts_tcpport'], 'ts_udp' => $CONF['ts_udpport'], 'ts_v' => $CONF['ts_version'], 'ts_login' => $CONF['ts_login'], 'ts_password' => $CONF['ts_password'], 'ts_cron' => $CONF['ts_cron_interval']));
    $template->show('TeamspeakPage.tpl');
}
Example #15
0
function ShowDisclamerPage()
{
    global $LNG, $USER;
    $CONF = Config::getAll(NULL, $_SESSION['adminuni']);
    if (!empty($_POST)) {
        $config_before = array('disclamerAddress' => $CONF['disclamerAddress'], 'disclamerPhone' => $CONF['disclamerPhone'], 'disclamerMail' => $CONF['disclamerMail'], 'disclamerNotice' => $CONF['disclamerNotice']);
        $disclamerAddress = HTTP::_GP('disclamerAddress', '', true);
        $disclamerPhone = HTTP::_GP('disclamerPhone', '', true);
        $disclamerMail = HTTP::_GP('disclamerMail', '', true);
        $disclamerNotice = HTTP::_GP('disclamerNotice', '', true);
        $config_after = array('disclamerAddress' => $disclamerAddress, 'disclamerPhone' => $disclamerPhone, 'disclamerMail' => $disclamerMail, 'disclamerNotice' => $disclamerNotice);
        Config::update($config_after);
        $CONF = Config::getAll(NULL, $_SESSION['adminuni']);
        $LOG = new Log(3);
        $LOG->target = 5;
        $LOG->old = $config_before;
        $LOG->new = $config_after;
        $LOG->save();
    }
    $template = new template();
    $template->loadscript('../base/jquery.autosize-min.js');
    $template->execscript('$(\'textarea\').autosize();');
    $template->assign_vars(array('disclamerAddress' => $CONF['disclamerAddress'], 'disclamerPhone' => $CONF['disclamerPhone'], 'disclamerMail' => $CONF['disclamerMail'], 'disclamerNotice' => $CONF['disclamerNotice'], 'se_server_parameters' => $LNG['mu_disclamer'], 'se_save_parameters' => $LNG['se_save_parameters'], 'se_disclamerAddress' => $LNG['se_disclamerAddress'], 'se_disclamerPhone' => $LNG['se_disclamerPhone'], 'se_disclamerMail' => $LNG['se_disclamerMail'], 'se_disclamerNotice' => $LNG['se_disclamerNotice']));
    $template->show('DisclamerConfigBody.tpl');
}
 /**
  * Serialize the form into the database.
  *
  */
 public function save($con = null)
 {
     if ($this->getObject()) {
         $j = $this->getObject();
     } else {
         $j = new Job();
     }
     $j->setPublicationId($this->getValue("publication_id"));
     $j->setStatusId($this->getValue("status_id"));
     $j->setEvent($this->getValue("event"));
     $j->setDate($this->getValue("date"));
     $j->setStartTime($this->getValue("start_time"));
     $j->setEndTime($this->getValue("end_time"));
     $j->setDueDate($this->getValue("due_date"));
     $j->setContactName($this->getValue("contact_name"));
     $j->setContactPhone($this->getValue("contact_phone"));
     $j->setContactEmail($this->getValue("contact_email"));
     $j->setAcctNum($this->getValue("acct_num"));
     $j->save();
     $logEntry = new Log();
     $logEntry->setWhen(time());
     $logEntry->setPropelClass("Job");
     $logEntry->setSfGuardUserProfileId(sfContext::getInstance()->getUser()->getUserId());
     $logEntry->setMessage("Basic info updated.");
     $logEntry->setLogMessageTypeId(sfConfig::get("app_log_type_update"));
     $logEntry->setPropelId($j->getId());
     $logEntry->save();
 }
function ShowFleetsConfPage()
{
    global $LNG;
    $CONF = Config::getAll(NULL, 1);
    if (!empty($_POST)) {
        $pay_before = array('fleetconf' => $CONF['fleetconf']);
        $fleetconf = TIMESTAMP + $_POST['days'] * 24 * 60 * 60;
        $pay_after = array('fleetconf' => $fleetconf);
        Config::update($pay_after, 1);
        $CONF = Config::getAll(NULL, 1);
        $LOG = new Log(3);
        $LOG->target = 1;
        $LOG->old = $pay_before;
        $LOG->new = $pay_after;
        $LOG->save();
        require_once 'includes/functions/BBCode.php';
        $Time = TIMESTAMP;
        $Message = '<span class="admin">All promotional fleets and defence have been unlocked until ' . date("d.m.Y - H:i:s", $CONF['fleetconf']) . '. - <a href="?page=shipyard&mode=fleet">Fleet</a> - <a href="?page=shipyard&mode=defence">Defence</a>';
        $From = '<span class="admin">"Antimatter"</span>';
        $pmSubject = '<span class="admin">"Purchase Bonus"</span>';
        $pmMessage = '<span class="admin">' . bbcode($Message) . '</span>';
        $USERS = $GLOBALS['DATABASE']->query("SELECT `id`, `username` FROM " . USERS . " WHERE `universe` = '1';");
        while ($UserData = $GLOBALS['DATABASE']->fetch_array($USERS)) {
            $sendMessage = str_replace('{USERNAME}', $UserData['username'], $pmMessage);
            SendSimpleMessage($UserData['id'], $USER['id'], TIMESTAMP, 50, $From, $pmSubject, $sendMessage);
        }
    }
    $template = new template();
    $template->assign_vars(array('fleetconf' => $CONF['fleetconf'], 'bonus_next_active' => $CONF['fleetconf'] > TIMESTAMP ? $CONF['fleetconf'] - TIMESTAMP : 0, 'bonus_next_active_timer' => $CONF['fleetconf'] > TIMESTAMP ? date("d.m.Y H:i:s", $CONF['fleetconf']) : 0));
    $template->show('fleetconf.tpl');
}
Example #18
0
 public function insert($error)
 {
     $log = new Log();
     $log->error = $error;
     $log->type = $this->accType;
     $log->save();
 }
Example #19
0
function ShowChatConfigPage()
{
    global $LNG;
    $config = Config::get(Universe::getEmulated());
    if (!empty($_POST)) {
        $config_before = array('chat_closed' => $config->chat_closed, 'chat_allowchan' => $config->chat_allowchan, 'chat_allowmes' => $config->chat_allowmes, 'chat_allowdelmes' => $config->chat_allowdelmes, 'chat_logmessage' => $config->chat_logmessage, 'chat_nickchange' => $config->chat_nickchange, 'chat_botname' => $config->chat_botname, 'chat_channelname' => $config->chat_channelname);
        $chat_allowchan = isset($_POST['chat_allowchan']) && $_POST['chat_allowchan'] == 'on' ? 1 : 0;
        $chat_allowmes = isset($_POST['chat_allowmes']) && $_POST['chat_allowmes'] == 'on' ? 1 : 0;
        $chat_allowdelmes = isset($_POST['chat_allowdelmes']) && $_POST['chat_allowdelmes'] == 'on' ? 1 : 0;
        $chat_logmessage = isset($_POST['chat_logmessage']) && $_POST['chat_logmessage'] == 'on' ? 1 : 0;
        $chat_nickchange = isset($_POST['chat_nickchange']) && $_POST['chat_nickchange'] == 'on' ? 1 : 0;
        $chat_closed = isset($_POST['chat_closed']) && $_POST['chat_closed'] == 'on' ? 1 : 0;
        $chat_channelname = HTTP::_GP('chat_channelname', '', true);
        $chat_botname = HTTP::_GP('chat_botname', '', true);
        $config_after = array('chat_closed' => $chat_closed, 'chat_allowchan' => $chat_allowchan, 'chat_allowmes' => $chat_allowmes, 'chat_allowdelmes' => $chat_allowdelmes, 'chat_logmessage' => $chat_logmessage, 'chat_nickchange' => $chat_nickchange, 'chat_botname' => $chat_botname, 'chat_channelname' => $chat_channelname);
        foreach ($config_after as $key => $value) {
            $config->{$key} = $value;
        }
        $config->save();
        $LOG = new Log(3);
        $LOG->target = 3;
        $LOG->old = $config_before;
        $LOG->new = $config_after;
        $LOG->save();
    }
    $template = new template();
    $template->assign_vars(array('chat_closed' => $config->chat_closed, 'chat_allowchan' => $config->chat_allowchan, 'chat_allowmes' => $config->chat_allowmes, 'chat_logmessage' => $config->chat_logmessage, 'chat_nickchange' => $config->chat_nickchange, 'chat_botname' => $config->chat_botname, 'chat_channelname' => $config->chat_channelname, 'se_server_parameters' => $LNG['se_server_parameters'], 'se_save_parameters' => $LNG['se_save_parameters'], 'ch_closed' => $LNG['ch_closed'], 'ch_allowchan' => $LNG['ch_allowchan'], 'ch_allowmes' => $LNG['ch_allowmes'], 'ch_allowdelmes' => $LNG['ch_allowdelmes'], 'ch_logmessage' => $LNG['ch_logmessage'], 'ch_nickchange' => $LNG['ch_nickchange'], 'ch_botname' => $LNG['ch_botname'], 'ch_channelname' => $LNG['ch_channelname']));
    $template->show('ChatConfigBody.tpl');
}
 public function save()
 {
     $Log = new Log($this->data->Log);
     $Log->save();
     $go = '>auth/Log/formObject/' . $Log->getId();
     $this->renderPrompt('information', 'OK', $go);
 }
 function _initialize()
 {
     $log_id = $this->writeControllerLog();
     // 先写入日志表中
     if (true !== C("DISABLE_ACTION_AUTH_CHECK")) {
         // 进行验证
         $this->cacheControllerList = DxFunction::getModuleControllerForMe();
         //用户的所有权限列表菜单
         if (!DxFunction::checkNotAuth(C('NOT_AUTH_ACTION'), C('REQUIST_AUTH_ACTION'))) {
             //dump(session());
             //dump(session(C("USER_AUTH_KEY")));die;
             if (0 == intval(session(C("USER_AUTH_KEY")))) {
                 $url = C("LOGIN_URL");
                 if ($url[0] != "/") {
                     //$url = U($url);
                     $url = '/Home/' . $url;
                 } else {
                     $url = '/Home' . $url;
                 }
                 redirect($url, 0, "");
             }
             // 判断用户是否有当前动作操作权限
             $privilege = $this->check_controller_privilege();
             if (!$privilege) {
                 //无权限
                 if ($log_id) {
                     $this->updateActionLog($log_id);
                 }
                 if (C('LOG_RECORD')) {
                     Log::save();
                 }
                 $this->success("您无权访问此页面!", "showmsg");
                 exit;
             }
         }
     }
     //自定义皮肤
     if (cookie('RESTHOME_SKIN_ROOT')) {
         $SKIN_ROOT = $_COOKIE['RESTHOME_SKIN_ROOT'];
     } else {
         //这里虽然__PUBLIC__ 是一个字符串 但是加载到模板里面 就会自动解析了
         // 要记得在配置文件里面 定义一下 DEFAULT_SKIN
         $SKIN_ROOT = "__PUBLIC__/project/Skin/" . C("DEFAULT_SKIN") . "/";
     }
     $this->assign('SKIN_ROOT', $SKIN_ROOT);
     //将系统变量加载到config中,供系统使用。
     $sysSetData = S("Cache_Global_SysSeting");
     if (empty($sysSetData)) {
         $sysSet = D("SysSetting");
         $sysSetData = $sysSet->select();
         S("Cache_Global_SysSeting", $sysSetData);
         //dump(M()->query($sql='show tables'));die;
     }
     //dump($sysSetData);exit;
     //放到系统配置里面了
     foreach ($sysSetData as $set) {
         C("SysSet." . $set["name"], $set["val"]);
     }
 }
Example #22
0
 public function log($message)
 {
     $model = new Log();
     $model->user_id = Yii::app()->user->getId();
     $model->action = $message;
     $model->created = date('Y-m-d H:i:s');
     $model->save();
 }
Example #23
0
 public static function log($type, $message, $table_name = null, $item_id = null, $current_user_id = null)
 {
     $log = new Log();
     $log->type = $type;
     $log->message = $message;
     $log->table_name = $table_name;
     $log->item_id = $item_id;
     $log->user_id = $current_user_id;
     return $log->save();
 }
Example #24
0
File: Boot.php Project: jyht/v5
 public static function run()
 {
     self::loadEventClass();
     event("APP_START");
     DEBUG and Debug::start("APP_START");
     self::init();
     self::start();
     DEBUG and Debug::show("APP_START", "APP_END");
     Log::save();
     event("APP_END");
 }
Example #25
0
 public static function addEmailLogMessage($jobId, $emailType, $toUser)
 {
     $logEntry = new Log();
     $logEntry->setWhen(time());
     $logEntry->setPropelClass("Job");
     $logEntry->setSfGuardUserProfileId(sfContext::getInstance()->getUser()->getUserId());
     $logEntry->setMessage($emailType . " sent to user " . $toUser);
     $logEntry->setLogMessageTypeId(sfConfig::get("app_log_type_email"));
     $logEntry->setPropelId($jobId);
     $logEntry->save();
 }
Example #26
0
File: ~boot.php Project: jyht/v5
 public static function run()
 {
     session(C("SESSION_OPTIONS"));
     self::loadEventClass();
     event("APP_START");
     DEBUG and Debug::start("APP_START");
     self::start();
     DEBUG and Debug::show("APP_START", "APP_END");
     Log::save();
     event("APP_END");
 }
Example #27
0
 public function delete(PropelPDO $con = null)
 {
     $logEntry = new Log();
     $logEntry->setWhen(time());
     $logEntry->setPropelClass("Project");
     $logEntry->setSfGuardUserProfileId(sfContext::getInstance()->getUser()->getUserId());
     $logEntry->setMessage("Project deleted.");
     $logEntry->setLogMessageTypeId(sfConfig::get("app_log_type_delete"));
     $logEntry->setPropelId($this->getId());
     $logEntry->save();
     parent::delete($con);
 }
Example #28
0
 public function putToLog($operation)
 {
     $logMessage = new Log();
     $logMessage->operation = $operation;
     $logMessage->object_type = __CLASS__;
     $logMessage->object_name = $this->getLogName();
     $logMessage->object_id = $this->getPk();
     $logMessage->manager_id = fvSite::$fvSession->getUser() ? fvSite::$fvSession->getUser()->getPk() : -1;
     $logMessage->message = $this->getLogMessage($operation);
     $logMessage->edit_link = fvSite::$fvConfig->get('dir_web_root') . "sites/edit/?id=" . $this->getPk();
     $logMessage->save();
 }
 public function executeSignout($request)
 {
     $log = new Log();
     $log->setAction('Logout');
     if ($this->getUser()) {
         $log->setUserId($this->getUser()->getGuardUser()->getId());
     }
     $log->save();
     $this->getUser()->signOut();
     $signoutUrl = sfConfig::get('app_sf_guard_plugin_success_signout_url', $request->getReferer());
     $this->redirect('' != $signoutUrl ? $signoutUrl : '@homepage');
 }
 public function logEntry($id)
 {
     $browser_info = getBrowser();
     $model = new Log;
     $model->user_id = $id;
     $model->ip_address = $_SERVER['REMOTE_ADDR'];
     $model->browser = $browser_info['name']; 
     $model->platform = $browser_info['platform']; 
     $model->os = $browser_info['platform'];
     $model->user_agent = $browser_info['userAgent'];
     $model->save();
 }