This App will require an extra plug in into your blog so that it can be managed. This file contains the "MainController". It will manage the first view of the blog, and some main features.
Author: Aditya Situmeang, Omeoo Media
Inheritance: extends CI_Controller
示例#1
0
 /**
  * Dispatch an event to the modules, will call the
  *  modules with the EventListener() function.
  *
  * @see http://www.nsslive.net/codon/docs/events
  * @param string $eventname
  * @param string $origin
  * @param list $params list additional parameters after $origin
  * @return boolean true by default
  */
 public static function Dispatch($eventname, $origin)
 {
     // if there are parameters added, then call the function
     //	using those additional params
     $params = array();
     $params[0] = $eventname;
     $params[1] = $origin;
     $args = func_num_args();
     if ($args > 2) {
         for ($i = 2; $i < $args; $i++) {
             $tmp = func_get_arg($i);
             array_push($params, $tmp);
         }
     }
     # Load each module and call the EventListen function
     if (!self::$listeners) {
         self::$listeners = array();
     }
     foreach (self::$listeners as $ModuleName => $Events) {
         $ModuleName = strtoupper($ModuleName);
         global ${$ModuleName};
         # Run if no specific events specified, or if the eventname is there
         if (!$Events || in_array($eventname, $Events)) {
             self::$lastevent = $eventname;
             MainController::Run($ModuleName, 'EventListener', $params);
             if (isset(self::$stopList[$eventname]) && self::$stopList[$eventname] == true) {
                 unset(self::$stopList[$eventname]);
                 return false;
             }
         }
     }
     return true;
 }
示例#2
0
 /**
  * Function: submit
  * Submits a post to the blog owner.
  */
 public function route_submit()
 {
     if (!Visitor::current()->group->can("submit_article")) {
         show_403(__("Access Denied"), __("You do not have sufficient privileges to submit articles."));
     }
     if (!empty($_POST)) {
         if (!isset($_POST['hash']) or $_POST['hash'] != Config::current()->secure_hashkey) {
             show_403(__("Access Denied"), __("Invalid security key."));
         }
         if (empty($_POST['body'])) {
             Flash::notice(__("Post body can't be empty!"), redirect("/"));
         }
         if (!isset($_POST['draft'])) {
             $_POST['draft'] = "true";
         }
         $_POST['body'] = "{$_POST['body']}\n\n\n{$_POST['name']}\n{$_POST['email']}\n";
         $post = Feathers::$instances[$_POST['feather']]->submit();
         if (!in_array(false, $post)) {
             Flash::notice(__("Thank you for your submission. ", "submission"), "/");
         }
     }
     if (Theme::current()->file_exists("forms/post/submit")) {
         MainController::current()->display("forms/post/submit", array("feather" => $feather), __("Submit a Text Post"));
     } else {
         require "pages/submit.php";
     }
 }
示例#3
0
 public function __construct($action, $urlValues)
 {
     parent::__construct($action, $urlValues);
     //create the model object
     require "protected/models/news.php";
     $this->model = new NewsModel();
 }
 function init()
 {
     parent::init();
     #$this->view->contentItemUri = $this->Content->getItemUri(); #@deprecated since 5/7/2009 use url()!
     if (empty($this->Content->ItemCountPerPage)) {
         $this->Content->ItemCountPerPage = 15;
     }
 }
 public function beforeAction($action)
 {
     parent::beforeAction($action);
     if (Yii::app()->user->model->rang == 1) {
         return true;
     } else {
         throw new CHttpException(403, "Не дорос еще");
     }
 }
示例#6
0
 public function init()
 {
     parent::init();
     if (isset($this->_user->loggedIn)) {
         $loggedIn = $this->_user->loggedIn;
         $this->_project = new Project();
         $this->_project->setUserData($loggedIn->uid, $this->_user->getPath(), $loggedIn->name, $loggedIn->email);
     }
 }
示例#7
0
 public function delete_link($text = null, $before = null, $after = null, $classes = "")
 {
     if (!$this->deletable()) {
         return false;
     }
     fallback($text, __("Delete"));
     $name = strtolower(get_class($this));
     echo $before . '<a href="' . url("delete_attachment/" . $this->id, MainController::current()) . '" title="Delete" class="' . ($classes ? $classes . " " : '') . $name . '_delete_link delete_link" id="' . $name . '_delete_' . $this->id . '">' . $text . '</a>' . $after;
 }
示例#8
0
文件: xmlrpc.php 项目: relisher/chyrp
 public function pingback_ping($args)
 {
     $config = Config::current();
     $linked_from = str_replace('&amp;', '&', $args[0]);
     $linked_to = str_replace('&amp;', '&', $args[1]);
     $cleaned_url = str_replace(array("http://www.", "http://"), "", $config->url);
     if ($linked_to == $linked_from) {
         return new IXR_ERROR(0, __("The from and to URLs cannot be the same."));
     }
     if (!substr_count($linked_to, $cleaned_url)) {
         return new IXR_Error(0, __("There doesn't seem to be a valid link in your request."));
     }
     if (preg_match("/url=([^&#]+)/", $linked_to, $url)) {
         $post = new Post(array("url" => $url[1]));
     } else {
         $post = MainController::current()->post_from_url(null, str_replace(rtrim($config->url, "/"), "/", $linked_to), true);
     }
     if (!$post) {
         return new IXR_Error(33, __("I can't find a post from that URL."));
     }
     # Wait for the "from" server to publish
     sleep(1);
     $from = parse_url($linked_from);
     if (empty($from["host"])) {
         return false;
     }
     if (empty($from["scheme"]) or $from["scheme"] != "http") {
         $linked_from = "http://" . $linked_from;
     }
     # Grab the page that linked here.
     $content = get_remote($linked_from);
     # Get the title of the page.
     preg_match("/<title>([^<]+)<\\/title>/i", $content, $title);
     $title = $title[1];
     if (empty($title)) {
         return new IXR_Error(32, __("There isn't a title on that page."));
     }
     $content = strip_tags($content, "<a>");
     $url = preg_quote($linked_to, "/");
     if (!preg_match("/<a[^>]*{$url}[^>]*>([^>]*)<\\/a>/", $content, $context)) {
         $url = str_replace("&", "&amp;", preg_quote($linked_to, "/"));
         if (!preg_match("/<a[^>]*{$url}[^>]*>([^>]*)<\\/a>/", $content, $context)) {
             $url = str_replace("&", "&#038;", preg_quote($linked_to, "/"));
             if (!preg_match("/<a[^>]*{$url}[^>]*>([^>]*)<\\/a>/", $content, $context)) {
                 return false;
             }
         }
     }
     $context[1] = truncate($context[1], 100, "...", true);
     $excerpt = strip_tags(str_replace($context[0], $context[1], $content));
     $match = preg_quote($context[1], "/");
     $excerpt = preg_replace("/.*?\\s(.{0,100}{$match}.{0,100})\\s.*/s", "\\1", $excerpt);
     $excerpt = "[...] " . trim(normalize($excerpt)) . " [...]";
     Trigger::current()->call("pingback", $post, $linked_to, $linked_from, $title, $excerpt);
     return _f("Pingback from %s to %s registered!", array($linked_from, $linked_to));
 }
示例#9
0
 protected function executeBefore()
 {
     switch ($this->_action) {
         case 'view':
             $this->addTitle($this->_model->getTitle());
             $this->addCSS('view_message');
             break;
     }
     parent::executeBefore();
 }
示例#10
0
 public function __construct()
 {
     parent::__construct();
     Doo::loadClass('UserSession');
     $this->usession = new UserSession();
     $username = $this->usession->uget('username');
     if (!$username) {
         header('Location:' . DOO::conf()->SUBFOLDER . 'login');
     }
     $this->init();
 }
示例#11
0
 function __construct()
 {
     parent::__construct();
     $this->users_model = new UsersModel();
     $this->fields = $this->users_model->fields;
     $this->submit();
     $this->delete();
     $this->view();
     $this->edit();
     $this->add();
 }
 static function hoursMergeForRidesInfo($weekdayHours, $dateHours)
 {
     $result = array();
     MainController::printArray($dateHours);
     //        if ($weekdayHours['hour_from'] == $dateHours['hour_from']
     //                && $weekdayHours['hour_to'] == $dateHours['hour_to']
     //                && $weekdayHours['direction_id'] == $dateHours['direction_id'])
     //        {
     //            $result[] = $weekdayHours;
     //        }
     self::sortHours($result);
     return $result;
 }
 public function restEvents()
 {
     parent::restEvents();
     //        $this->onRest('post.filter.model.find.all', function($result) {
     //            foreach ($result as &$res) {
     //                if ($res['providers']['profile_photo']!="")
     //                        $res['providers']['profile_photo'] = Yii::app()->getBaseUrl(true) ."/images/". $res['providers']['profile_photo'];
     //                if ($res['users']['profile_photo']!="")
     //                        $res['users']['profile_photo'] = Yii::app()->getBaseUrl(true) ."/images/". $res['users']['profile_photo'];
     //            }
     //            return $result;
     //        });
 }
 public function __construct($registry)
 {
     parent::__construct($registry);
     $this->file = $this->sanitizePath(DIR_SYSTEM . '../vendor/openpay/Openpay.php');
     $minTotal = $this->currency->convert(1, 'USD', $this->currency->getCode());
     if (!defined('MODULE_CODE')) {
         define('MODULE_CODE', 'OPENPAY');
     }
     if (!defined('MODULE_NAME')) {
         define('MODULE_NAME', 'openpay_banks');
     }
     if (!defined('MIN_TOTAL')) {
         define('MIN_TOTAL', $minTotal);
     }
     if (!defined('TRANSACTION_CREATE_CUSTOMER')) {
         define('TRANSACTION_CREATE_CUSTOMER', 'Customer creation');
     }
     if (!defined('TRANSACTION_CREATE_CHARGE')) {
         define('TRANSACTION_CREATE_CHARGE', 'Charge creation');
     }
     if (!defined('TRANSACTION_CAPTURE_CHARGE')) {
         define('TRANSACTION_CAPTURE_CHARGE', 'Charge capture');
     }
     if (!defined('TRANSACTION_REFUND_CHARGE')) {
         define('TRANSACTION_REFUND_CHARGE', 'Charge refund');
     }
     if (!defined('TRANSACTION_CREATE_PLAN')) {
         define('TRANSACTION_CREATE_PLAN', 'Plan creation');
     }
     if (!defined('TRANSACTION_CREATE_SUBSCRIPTION')) {
         define('TRANSACTION_CREATE_SUBSCRIPTION', 'Subscription creation');
     }
     if (!defined('TRANSACTION_CANCEL_SUBSCRIPTION')) {
         define('TRANSACTION_CANCEL_SUBSCRIPTION', 'Subscription cancel');
     }
     if (!defined('TRANSACTION_CREATE_INVOICE')) {
         define('TRANSACTION_CREATE_INVOICE', 'Create invoice');
     }
     if (!defined('TRANSACTION_PAID_INVOICE')) {
         define('TRANSACTION_PAID_INVOICE', 'Invoice paid');
     }
     if (!defined('TRANSACTION_CREATE_ORDER')) {
         define('TRANSACTION_CREATE_ORDER', 'Order #%d was created');
     }
     if (!defined('PRO_MODE')) {
         define('PRO_MODE', false);
     }
     $this->decimalZero = array('BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'VND', 'VUV', 'XAF', 'XOF', 'XPF');
     $this->available_ps = array('pp_express', 'openpay_banks');
 }
示例#15
0
 function init()
 {
     parent::init();
     if (!$this->authAllowed) {
         $this->_redirect('/');
         die;
     }
     if ($this->authHTTPS) {
         FrontEnd::checkHTTPS();
     }
     $this->_formRender = isset($this->conf->auth->formRender) ? false : true;
     if (!isset($this->logoutRedirect)) {
         $this->logoutRedirect = '/';
     }
     $this->users = new Users();
     $this->view->mode = 'insert';
 }
 function __construct()
 {
     parent::__construct();
     global $settings;
     $this->settings = $settings;
     //todo - create better array structure with nested directories in parents as keys
     $this->dirs = array($this->settings['sfstore'], $this->settings['sfstore'] . '/db_backup', $this->settings['sfstore'] . '/db_backup/csv', $this->settings['sfstore'] . '/db_backup/database', $this->settings['sfstore'] . '/db_backup/tables', $this->settings['sfstore'] . '/file_backup', $this->settings['sfstore'] . '/file_backup/full', $this->settings['sfstore'] . '/file_backup/partial');
     $this->check_directory($this->dirs);
     $this->dashboard_model = new DashboardModel();
     $this->data['result'] = array();
     $this->data['script_url'] = $this->get_script_url();
     $this->current_page = filter_input(INPUT_GET, 'view');
     $this->data['current_page'] = $this->current_page;
     $this->view_url = $this->dashboard_model->settings['view_url'];
     $this->submit();
     $this->view();
 }
 public function restEvents()
 {
     parent::restEvents();
     //        $this->onRest('post.filter.model.find.all', function($result) {
     //            foreach ($result as &$res) {
     //                if ($res['profile_photo']!="")
     //                    $res['profile_photo'] = Yii::app()->getBaseUrl(true) . $res['profile_photo'];
     //            }
     //            return $result;
     //        });
     $this->onRest('model.find', function ($model, $id) {
         if (Yii::app()->user->checkAccess('manager') || Yii::app()->request->getQuery('id') == Yii::app()->user->id) {
             return $model->findByPk($id);
         } else {
             throw new CHttpException('400', CJSON::encode("Permmission denied"));
         }
     });
     $this->onRest('model.find.all', function ($model) {
         if (Yii::app()->user->checkAccess('manager')) {
             return $model->findAll();
         } else {
             throw new CHttpException('400', CJSON::encode("Permmission denied"));
         }
     });
     $this->onRest('model.visible.properties', function () {
         return [];
     });
     $this->onRest('model.hidden.properties', function () {
         return ["password", "authItems.type", "authItems.type", "authItems.data", "authItems.description", "authItems.bizrule"];
     });
     $this->onRest('model.save', function ($model) {
         if (isset($model['profile_photo']) && preg_match("/http[s]*:\\/\\//i", $data['profile_photo']) == 0) {
             $filename = Helper::_saveImageFromBas64($model['profile_photo'], Yii::app()->getBasePath() . Yii::app()->params->userImages);
             $model['profile_photo'] = Yii::app()->getBaseUrl(true) . Yii::app()->params->userRealImages . "{$filename}";
         }
         $model->key = md5(uniqid() . $model->password);
         if (!$model->save()) {
             throw new CHttpException('400', CJSON::encode($model->errors));
         }
         $model->refresh();
         return $model;
     });
 }
示例#18
0
 protected function executeBefore()
 {
     $this->addTitle('Forum');
     switch ($this->_action) {
         case 'open':
             $this->addTitle($this->_model->getName());
             $this->addCSS('open_forum');
             break;
         case 'create':
             $this->addTitle('add');
             $this->addCSS('create_forum');
             $this->addJS('create_forum');
             break;
         case 'restrict':
         case 'close':
         case 'free':
             $this->_show_view = false;
             break;
     }
     parent::executeBefore();
 }
示例#19
0
 public function __construct()
 {
     parent::__construct();
     Doo::loadClass('UserSession');
     Doo::loadHelper('DooTextHelper');
     $this->usession = new UserSession();
     $this->username = $this->usession->uget('username');
     $this->ppv_cat_code = 'C_TokoVideo_PPV';
     $this->svod_cat_code = 'C_TokoVideo_International';
     $this->ppv_start_date = '2012-10-24 23:00:00';
     $this->svod_start_date = '2012-08-31 23:00:00';
     /* Doo::loadClass('User');
     		$this->dbapi = new User();
     		$this->conf_data = array();
     		$this->conf_data['css'] = array('index.css','ui-lightness/jquery-ui-1.8.21.custom.css');
     		$this->conf_data['js'] = array('common.js','jquery.min.js','jquery-ui-1.8.21.custom.min.js');
     		$this->conf_data['title'] = 'UseeTV User Management';
     		$this->conf_data['content_view'] = 'content/list_user.php';
     		$this->conf_data['content_data'] = array(); */
     $this->init();
 }
示例#20
0
 public function setOptions()
 {
     switch ($this->_action) {
         case 'create':
             $this->setOption('new-permissions', array(TFRouter::getParam('new-permission')));
             break;
         case 'open':
             if (isset($this->_vars[0])) {
                 switch (is_numeric($this->_vars[0])) {
                     case true:
                         $this->setOption('id', $this->_vars[0]);
                         break;
                     case false:
                         $this->setOption('name', $this->_vars[0]);
                         break;
                 }
             }
             break;
     }
     parent::setOptions();
 }
 public function restEvents()
 {
     parent::restEvents();
     //        $this->onRest('post.filter.model.find.all', function($result) {
     //            foreach ($result as &$res) {
     //                if ($res['profile_photo']!="")
     //                    $res['profile_photo'] = Yii::app()->getBaseUrl(true) . $res['profile_photo'];
     //            }
     //            return $result;
     //        });
     $this->onRest('model.save', function ($model) {
         if (isset($model['profile_photo']) && preg_match("/http[s]*:\\/\\//i", $data['profile_photo']) == 0) {
             $filename = Helper::_saveImageFromBas64($model['profile_photo'], Yii::app()->getBasePath() . Yii::app()->params->salonImages);
             $model['profile_photo'] = Yii::app()->getBaseUrl(true) . Yii::app()->params->salonRealImages . "{$filename}";
         }
         if (!$model->save()) {
             throw new CHttpException('400', CJSON::encode($model->errors));
         }
         $model->refresh();
         return $model;
     });
 }
 public function addInstructorCalendarEvent($reservationsInfo, $instructorInfo, $prevInsrtuctorInfo, $hoursInfo)
 {
     $date = "";
     $description = "";
     $total_choosen_places = 0;
     $attendee_index = 0;
     $instructorID = $instructorInfo['id'];
     $hour_id = $hoursInfo['id'];
     $prevInsrtuctorID = $prevInsrtuctorInfo['id'];
     $reservationsInfoSize = count($reservationsInfo);
     for ($resIndex = 0; $resIndex < $reservationsInfoSize; $resIndex++) {
         if ($resIndex == 0) {
             $date = $reservationsInfo[$resIndex]['resDate'];
             $hourCursor = Dispatcher::$mysqli->query("select * from event join instructor " . "on event.`instructor_Person_id`=instructor.`Person_id` " . "where event.`date`='{$date}' " . "and (event.`instructor_Person_id`={$prevInsrtuctorID} or event.`instructor_Person_id`={$instructorID}) " . "and event.hours_id={$hour_id}");
             print_r(Dispatcher::$mysqli->error);
             if ($hourCursor->num_rows > 0) {
                 $hourRow = $hourCursor->fetch_assoc();
                 $prev_calendar_id = $hourRow['calendar_id'];
                 $prev_event_id = $hourRow['clndr_event_id'];
                 $event = $this->google_api_service->events->get($prev_calendar_id, $prev_event_id);
             } else {
                 $event = new Google_Service_Calendar_Event();
                 $event->setLocation('Saska, Praha 1');
                 $start = new Google_Service_Calendar_EventDateTime();
                 $start->setDateTime($reservationsInfo[$resIndex]['resDate'] . 'T' . $reservationsInfo[$resIndex]['hour_from'] . ':00.000+02:00');
                 $start->setTimeZone('Europe/Prague');
                 $event->setStart($start);
                 $end = new Google_Service_Calendar_EventDateTime();
                 $end->setDateTime($reservationsInfo[$resIndex]['resDate'] . 'T' . $reservationsInfo[$resIndex]['hour_to'] . ':00.000+02:00');
                 $end->setTimeZone('Europe/Prague');
                 $event->setEnd($end);
             }
         }
         $client_email = $reservationsInfo[$resIndex]['email'];
         $client_name = $reservationsInfo[$resIndex]['name'];
         $client_telefon = $reservationsInfo[$resIndex]['telefone'];
         $choosen_places = $reservationsInfo[$resIndex]['choosen_places'];
         $voucherName = $reservationsInfo[$resIndex]['vocuherName'];
         $total_choosen_places += $choosen_places;
         MainController::printArray($reservationsInfo);
         $description .= $client_name . "\n" . $client_email . "\n" . $client_telefon . "\n" . $choosen_places . "\n\n";
         $attendee[$attendee_index] = new Google_Service_Calendar_EventAttendee();
         $attendee[$attendee_index]->setEmail($client_email);
         $attendee[$attendee_index]->setDisplayName($client_name);
         $attendee[$attendee_index]->setOptional($client_telefon);
         $attendee_index++;
     }
     if ($reservationsInfoSize > 0) {
         if ($hourCursor->num_rows > 0) {
             try {
                 $event->setSummary($total_choosen_places . " " . $voucherName);
                 $event->description = $description;
                 $event->attendees = $attendee;
                 $updatedEvent = $this->google_api_service->events->update($prevInsrtuctorInfo['calendar_id'], $event->getId(), $event);
             } catch (Google_Service_Exception $e) {
                 echo '<pre>';
                 print_r($e);
                 syslog(LOG_ERR, $e->getMessage());
             }
             $event = $this->google_api_service->events->get($prevInsrtuctorInfo['calendar_id'], $updatedEvent->getId());
             $event_id = $event->getId();
             Dispatcher::$mysqli->query("update event set clndr_event_id='{$event_id}', `instructor_Person_id`={$instructorID} " . "where date='{$date}' and hours_id={$hour_id} and `instructor_Person_id`={$prevInsrtuctorID}");
             if ($prev_calendar_id != $instructorInfo['calendar_id']) {
                 $result = $this->google_api_service->events->move($prev_calendar_id, $event_id, $instructorInfo['calendar_id']);
                 print_r(Dispatcher::$mysqli->error);
                 echo '<pre>';
                 print_r($result);
             }
         } else {
             try {
                 $event->attendees = $attendee;
                 $event->description = $description;
                 $organizer = new Google_Service_Calendar_EventOrganizer();
                 $organizer->setEmail($instructorInfo['email']);
                 $organizer->setDisplayName($instructorInfo['name']);
                 $event->setOrganizer($organizer);
                 $new_event = $this->google_api_service->events->insert($instructorInfo['calendar_id'], $event);
             } catch (Google_Service_Exception $e) {
                 echo '<pre>';
                 print_r($e);
                 syslog(LOG_ERR, $e->getMessage());
             }
             $event = $this->google_api_service->events->get($instructorInfo['calendar_id'], $new_event->getId());
             $instructorID = $instructorInfo['id'];
             $hour_id = $hoursInfo['id'];
             $event_id = $event->getId();
             Dispatcher::$mysqli->query("insert into event(clndr_event_id, `instructor_Person_id`, hours_id, date, has_changes) " . "values('{$event_id}', {$instructorID}, {$hour_id}, '{$date}', 0)");
             if ($event != null) {
                 //                    echo "Inserted:<br>";
                 //                    echo "EventID=" . $event->getId() . " <br>";
                 //                    echo "Summary=" . $event->getSummary() . " <br>";
                 //                    echo "Status=" . $event->getStatus();
             }
         }
     }
 }
示例#23
0
<?php

$app->get('/', function () use($app) {
    require 'controllers/MainController.php';
    $controller = new MainController();
    $controller->index($app);
});
$app->post('/registration', function () use($app) {
    require 'controllers/RegistrationController.php';
    require 'models/RegistrationModel.php';
    $controller = new RegistrationController();
    $controller->index($app);
});
$app->post('/auth', function () use($app) {
    require 'controllers/AuthController.php';
    require 'models/AuthModel.php';
    $controller = new AuthController();
    $controller->index($app);
});
示例#24
0
 public function beforeRender($view)
 {
     parent::beforeRender($view);
     $this->rewriteForSeo();
     return true;
 }
示例#25
0
 * @author Nabeel Shahzad
 * @copyright Copyright (c) 2008, Nabeel Shahzad
 * @link http://www.phpvms.net
 * @license http://creativecommons.org/licenses/by-nc-sa/3.0/
 */
/*	This is the maintenance cron file, which can run nightly. 
	You should either point to this file directly in your web-host's control panel
	Or add an entry into the crontab file. I recommend running this maybe 2-3am, 
 */
define('ADMIN_PANEL', true);
include dirname(dirname(__FILE__)) . '/core/codon.config.php';
Auth::$userinfo->pilotid = 0;
error_reporting(E_ALL);
ini_set('display_errors', 'on');
/* Clear expired sessions */
Auth::clearExpiredSessions();
/* Update any expenses */
FinanceData::updateAllExpenses();
if (Config::Get('PILOT_AUTO_RETIRE') == true) {
    /* Find any retired pilots and set them to retired */
    PilotData::findRetiredPilots();
    CronData::set_lastupdate('find_retired_pilots');
}
if (Config::Get('CLOSE_BIDS_AFTER_EXPIRE') === false) {
    SchedulesData::deleteExpiredBids();
    CronData::set_lastupdate('check_expired_bids');
}
MaintenanceData::optimizeTables();
MainController::Run('Maintenance', 'resetpirepcount');
MainController::Run('Maintenance', 'resethours');
<?php

$_POST['filter'] = "all";
$instagram_photos = MainController::getInstaPhotos();
$size = count($instagram_photos);
?>

<div class="modal fade" id="instagram_popup" role="dialog" 
     data-backdrop="static" aria-labelledby="instagram_popup" 
     aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="global-close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <!--<div class="modal-title">INSTAGRAM</div>-->
            </div>
            <div class="modal-body">
                <div id="contacts-container">                    
                    <div class="tab-contents">
                        <div class="tours-contents-title">
                            <?php 
echo $instagram_popup_text['title'];
?>
                        </div>
                    </div>
                    <div class="tab-contents-subtitle">
                        <?php 
echo $instagram_popup_text['subtitle'];
?>
                    </div>
                </div>
示例#27
0
 */
define('ADMIN_PANEL', true);
include '../core/codon.config.php';
if (!Auth::LoggedIn()) {
    Debug::showCritical('Please login first');
    die;
}
if (!PilotGroups::group_has_perm(Auth::$usergroups, ACCESS_ADMIN)) {
    Debug::showCritical('Unauthorized access');
    die;
}
$BaseTemplate = new TemplateSet();
$tplname = Config::Get('ADMIN_SKIN');
if ($tplname == '') {
    $tplname = 'layout';
}
//load the main skin
$settings_file = SITE_ROOT . '/admin/lib/' . $tplname . '/' . $tplname . '.php';
if (file_exists($settings_file)) {
    include $settings_file;
}
$BaseTemplate->template_path = SITE_ROOT . '/admin/lib/' . $tplname;
$BaseTemplate->Set('title', SITE_NAME);
Template::Set('MODULE_NAV_INC', $NAVBAR);
Template::Set('MODULE_HEAD_INC', $HTMLHead);
$BaseTemplate->Show('header.tpl');
flush();
MainController::runAllActions();
$BaseTemplate->Show('footer.tpl');
# Force connection close
DB::close();
示例#28
0
require_once 'model/Database.php';
require_once 'view/LoginView.php';
require_once 'view/DateTimeView.php';
require_once 'view/LayoutView.php';
require_once 'view/RegisterView.php';
require_once 'controller/LoginController.php';
require_once 'controller/RegisterController.php';
require_once 'controller/MainController.php';
//MAKE SURE ERRORS ARE SHOWN... MIGHT WANT TO TURN THIS OFF ON A PUBLIC SERVER
error_reporting(E_ALL);
ini_set('display_errors', 'On');
//Create models
$db = new Database();
$dal = new UserDAL($db);
$loginModel = new LoginModel($dal);
$registerModel = new RegisterModel($dal);
//CREATE OBJECTS OF THE VIEWS
$loginView = new LoginView($loginModel);
$registerView = new RegisterView($registerModel);
$dateTimeView = new DateTimeView();
$layoutView = new LayoutView();
//Create controllers
$loginController = new LoginController($loginView, $loginModel);
$registerController = new RegisterController($registerView, $loginView, $registerModel);
$mainController = new MainController($registerController, $loginController);
$mainController->listen();
if ($mainController->renderRegView()) {
    $layoutView->render(false, $registerView, $dateTimeView);
} else {
    $layoutView->render($loginModel->isLoggedIn(), $loginView, $dateTimeView);
}
示例#29
0
} else {
    $version = $_COOKIE['admin_version'];
}
$main_array = Dispatcher::main_getMain_map($language);
$map_center = $main_array['map_center'];
$main_info = Dispatcher::moduls_getInfo('main');
$user = Dispatcher::admin_getUser();
$popup_text = Dispatcher::getPopupInfo($language, "tours");
$about_seglfie_popup_text = Dispatcher::getPopupInfo($language, "about");
$questions_popup_text = Dispatcher::getPopupInfo($language, "questions");
$contacts_popup_text = Dispatcher::getPopupInfo($language, "contacts");
$instagram_popup_text = Dispatcher::getPopupInfo($language, "instagram");
$terms_popup_text = Dispatcher::getPopupInfo($language, "terms");
$company_popup_text = Dispatcher::getPopupInfo($language, "company");
$_POST['language'] = $language;
$directions_info = MainController::getDirInfo();
require '../menu_items.php';
?>

<!doctype html>
<html>

    <head>
        <meta charset="utf-8" />
        <title>Sysadmin3000 - <?php 
echo $menu_item_1;
?>
</title>
        <meta name="description" content="">
        <?php 
include_once '../includes/index.php';
示例#30
0
    if (Config::Get('DEBUG_MODE') == true) {
        DB::show_errors();
    } else {
        DB::hide_errors();
    }
    if (!DB::connect(DBASE_USER, DBASE_PASS, DBASE_NAME, DBASE_SERVER)) {
        Debug::showCritical(Lang::gs('database.connection.failed') . ' (' . DB::$errno . ': ' . DB::$error . ')');
        die;
    }
    # Set the charset type to send to mysql
    if (Config::Get('DB_CHARSET_NAME') !== '') {
        DB::query('SET NAMES \'' . Config::Get('DB_CHARSET_NAME') . '\'');
    }
    # Include ORM
    #include_once(VENDORS_PATH.DS.'orm'.DS.'idiorm.php');
    #include_once(VENDORS_PATH.DS.'orm'.DS.'paris.php');
    #ORM::configure('mysql:host='.DBASE_SERVER.';dbname='.DBASE_NAME);
    #ORM::configure('username', DBASE_USER);
    #ORM::configure('password', DBASE_PASS);
}
include CORE_PATH . DS . 'bootstrap.inc.php';
if (function_exists('pre_module_load')) {
    pre_module_load();
}
MainController::loadEngineTasks();
define('ACTIVE_SKIN_PATH', LIB_PATH . DS . 'skins' . DS . CURRENT_SKIN);
Template::setTemplatePath(TEMPLATES_PATH);
Template::setSkinPath(ACTIVE_SKIN_PATH);
if (function_exists('post_module_load')) {
    post_module_load();
}