Esempio n. 1
0
 /**
  * Create a new cron-task object instance.
  *
  * @param  string	$index_path
  * @param  string	$log_path
  * @return void
  */
 function __construct($index_path, $config_file = "config.ini", $log_file = null)
 {
     $this->_LOG_PATH = $log_file ? $log_file : 'logs/crons.log';
     require_once $index_path . './library/MantellaConfig.php';
     require_once $index_path . './library/MantellaException.php';
     require_once $index_path . './library/MantellaDBManager.php';
     require_once $index_path . './library/MantellaModel.php';
     require_once $index_path . './library/MantellaValidator.php';
     require_once $index_path . './library/MantellaCollection.php';
     require_once $index_path . './library/MantellaLocalization.php';
     require_once $index_path . './library/MantellaView.php';
     @set_include_path(get_include_path() . PATH_SEPARATOR . '../config/');
     CONF::init($config_file, realpath(dirname(__FILE__) . '/../') . '/');
 }
Esempio n. 2
0
File: init.php Progetto: vslko/mmvc
<?php

/* 
parameters:
  session = "connection=db;table=users;login=login;password=secret;encoding=md5;fields=id,login,name,email,role" 
*/
$LIB_NAME = "Session";
$LIB_ALIAS = "AUTH";
require_once dirname(__FILE__) . "/MantellaSession.php";
class_alias('MantellaSession', $LIB_ALIAS);
$parameters = explode(";", CONF::get('vendor_' . $LIB_NAME));
$params = array();
foreach ($parameters as $p) {
    $p = explode("=", trim($p));
    $params[trim($p[0])] = trim($p[1]);
}
AUTH::init($params);
Esempio n. 3
0
File: index.php Progetto: vslko/mmvc
 */
// ========== PREPARE =========
error_reporting(E_ALL);
session_start();
if (version_compare(PHP_VERSION, '5.0.0', '<')) {
    exit("Sorry, MantellaMVC needs PHP version 5+!\n");
}
// ========== ROUTING =========
// MOD_REWRITE please configure via .htaccess or httpd.conf
// ========== SYSTEM INCLUDES ==========
@set_include_path(get_include_path() . PATH_SEPARATOR . "../app/config/");
require_once '../core/MantellaConfig.php';
require_once '../core/MantellaApplication.php';
require_once '../core/MantellaDBManager.php';
// ========== INITIAL CONFIGURATION ==========
CONF::init("../app/config.ini", dirname(__FILE__) . '/../');
// ========== INIT APPLICATION ==========
$app = new MantellaApplication('Index', '_');
try {
    $app->run();
} catch (Exception $e) {
    $e->logException();
    header($e->getHttpHeader());
    MantellaView::template("errors/" . $e->getCode());
    if (MantellaView::is_template_attached()) {
        MantellaView::set('error', $e->getFullError());
        MantellaView::show();
    } else {
        print "<div style=\"margin:100px; padding:30px; border:1px dotted #C0C0C0;\">\n        \t     ERROR " . $e->getCode() . ": " . $e->getHttpCause() . "</b><br /><br />\n            \t <span style=\"font-size:11px; font-family:Arial; color:#777;\">\n                \t  &gt;&gt; Url: " . $_SERVER["SERVER_NAME"] . $_SERVER['REQUEST_URI'] . "<br >\n\t\t   \t   \t\t  &gt;&gt; Ref. Number: " . $e->getRef() . "<br />\n\t\t       \t\t  &gt;&gt; Please inform " . (defined('M_ADMIN_EMAIL') ? "<a style=\"color:#666;\" href=\"mailto: " . M_ADMIN_EMAIL . "\">administrator</a>" : "administrator") . " about this problem, thanks!\n\t\t     \t</span>\n\t\t   \t  </div>\n";
    }
}
Esempio n. 4
0
            <li <?php 
        CONF::activeLink($navbar, 'collection');
        ?>
><a href="<?php 
        echo $accessPath . 'index.php?section=collection';
        ?>
">Collection</a></li>
            <li <?php 
        CONF::activeLink($navbar, 'offres');
        ?>
><a href="<?php 
        echo $accessPath . 'index.php?section=offres';
        ?>
">Offres</a></li>
            <li <?php 
        CONF::activeLink($navbar, 'compte');
        ?>
 class="dropdown">
		            <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><?php 
        echo $_SESSION['user'];
        ?>
<span class="caret"></span></a>
					      <ul class="dropdown-menu" role="menu">
						      <li class="dropdown-header">Compte</li>
                  <?php 
        if ($_SESSION['admin']) {
            ?>
                    <li class="dropdown-header">Admin</li>
                  <?php 
        }
        ?>