Ejemplo n.º 1
0
 function __construct()
 {
     parent::__construct();
     $this->Shell = Core::GetShellInstance();
     $this->IfConfigBin = FCONFIG_BIN;
     $this->Eth = DEFAULT_ETH;
 }
Ejemplo n.º 2
0
 function __construct()
 {
     parent::__construct();
     $this->activeDirectory = $GLOBALS['config']['lib']['activeDirectory'];
     foreach ($this->activeDirectory as $activeDirectory) {
         $dn = explode('.', $activeDirectory['domain']);
         $ldapDN = '';
         foreach ($dn as $item) {
             $ldapDN = $ldapDN . 'DC=' . $item . ',';
         }
         $ldapDN = substr($ldapDN, 0, strlen($ldapDN) - 1);
         //colocar no array
         // Connect to AD
         $ad = ldap_connect($activeDirectory['host']);
         if (!$ad) {
             consoleWrite("Cant CONNECT to Active Directory!");
             return false;
         }
         ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, 7);
         ldap_set_option($ad, LDAP_OPT_PROTOCOL_VERSION, 3);
         ldap_set_option($ad, LDAP_OPT_REFERRALS, 0);
         ldap_set_option($ad, LDAP_OPT_SIZELIMIT, 1500);
         //LIMITA A QUANTIDADE DE REGISTROS RETORNADOS
         $this->activeDirectory[$activeDirectory['id']]['ad'] = $ad;
         $this->activeDirectory[$activeDirectory['id']]['ldapDN'] = $ldapDN;
     }
 }
Ejemplo n.º 3
0
 function __construct()
 {
     parent::__construct();
     $this->coreModule = $GLOBALS['CoreModule'];
     $this->toView['coreModule'] = $this->coreModule;
     /* LOAD THE AUTOLOAD LIBRARIES*/
     $libraries = explode('|', core::$config['autoload']);
     if (core::$config['autoload'] > '') {
         foreach ($libraries as $library) {
             $class = 'Core\\' . $library;
             if (class_exists($class)) {
                 $this->{$library} = new $class();
             } else {
                 if ($GLOBALS['CoreVars'][0] != 'AdminCore') {
                     $errorPage = "You have configured <b>{$library}</b> into AUTOLOAD, but it isn't in the lib folder. Please make sure that your instalation is ok";
                     require 'errorPage.php';
                 }
             }
         }
     }
     $this->baseLink = MODULEDIR;
     $this->toView['baseLink'] = $this->baseLink;
     //User to create easy links
     define('PAGEDIR', MODULEDIR . '/' . get_class($this));
 }
Ejemplo n.º 4
0
 /**
  * DBAdapter construcotr
  *
  * @param string $tableName Table name
  */
 public function __construct($tableName = null)
 {
     parent::__construct();
     // Get the LOG table name
     $this->TableName = is_null($tableName) ? self::LOG_DB_TABLE : $tableName;
     $this->Options = array('fieldMessage' => 'message', 'fieldLevel' => 'level', 'fieldDatetime' => false, 'fieldTimestamp' => false, 'fieldTrnID' => false);
 }
Ejemplo n.º 5
0
 function __construct()
 {
     parent::__construct();
     $table = 'lib_statistics';
     $sqlite = new sqlite($table);
     $this->sqlite = $sqlite;
     $data = $sqlite->select();
     if (isset($_SERVER['HTTP_USER_AGENT'])) {
         $this->user_agent = $_SERVER['HTTP_USER_AGENT'];
         $this->language = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
     } else {
         $this->user_agent = 'UPDATING';
         $this->language = 'UPDATING';
     }
     if (!$data) {
         $stmt = "CREATE TABLE IF NOT EXISTS {$table} (\n\t\t\t\t\t\tid INTEGER NOT NULL,\n\t\t\t\t\t\tip TEXT(15) NOT NULL,\n\t\t\t\t\t\tuser_agent TEXT(100) NOT NULL,\n\t\t\t\t\t\tlanguage TEXT(100) NOT NULL,\n\t\t\t\t\t\tfirst_access TEXT(19) NOT NULL,\n\t\t\t\t\t\tlast_access TEXT(19) NOT NULL,\n\t\t\t\t\t\tPRIMARY KEY ('id')\n\t\t\t\t\t);";
         $sqlite->exec($stmt);
     }
     $data = $sqlite->selectWhere('ip = "' . $_SERVER['REMOTE_ADDR'] . '"');
     if (!$data) {
         $this->insert();
     } else {
         if ($data['user_agent'] != $this->user_agent) {
             $this->insert();
         } else {
             $this->update($data['id']);
         }
     }
 }
Ejemplo n.º 6
0
 /**
  * Constructs a Session object.
  */
 function __construct()
 {
     parent::__construct();
     $this->cache = new Cache('session');
     $this->password = new Password();
     /*session_set_save_handler(
     			array(&$this, 'open'),
     			array(&$this, 'close'),
     			array(&$this, 'read'),
     			array(&$this, 'write'),
     			array(&$this, 'destroy'),
     			array(&$this, 'clean'));
     		*/
     $this->create();
     if (isset($_COOKIE[session_name()])) {
         session_id($_COOKIE[session_name()]);
     }
     $this->params = array("lifetime" => SESSION_EXPIRE, "path" => ini_get("session.cookie_path"), "domain" => ini_get("session.cookie_domain"), "secure" => ini_get("session.cookie_secure"), "httponly" => ini_get("session.cookie_httponly"));
     session_start();
     $data = $this->get();
     $this->set_cookie($data && $data["remember"]);
     // check to see if ips match and if session still active
     if ($data && $_SERVER['REMOTE_ADDR'] === $data['ip'] && $data["ua"] === $_SERVER['HTTP_USER_AGENT']) {
         // place data in session cookie
         if (!$data["remember"] || $data["timestamp"] + $this->params["lifetime"] > $_SERVER['REQUEST_TIME']) {
             $this->cookie = $data;
             $this->cookie["timestamp"] = $_SERVER['REQUEST_TIME'];
         } else {
             $this->del();
         }
     }
     $this->set();
     $this->make_defined();
 }
Ejemplo n.º 7
0
 public function __construct()
 {
     parent::__construct();
     $this->_oWallModel = new WallModel();
     $this->_oAvatarDesign = new AvatarDesignCore();
     // Avatar Design Class
     switch ($this->httpRequest->post('type')) {
         case 'show':
             $this->show();
             break;
         case 'showCommentProfile':
             $this->showCommentProfile();
             break;
         case 'add':
             $this->add();
             break;
         case 'edit':
             $this->edit();
             break;
         case 'delete':
             $this->delete();
             break;
         default:
             Framework\Http\Http::setHeadersByCode(400);
             exit('Bad Request Error!');
     }
 }
Ejemplo n.º 8
0
 /**
  * Constructs a Account object.
  */
 function __construct()
 {
     global $session;
     parent::__construct();
     $this->session = $session;
     $this->password = new Password();
 }
Ejemplo n.º 9
0
		/**
		* Constructor
		* @access public
		* @param string $host Host to connect
		* @param int $port Port to connect
		* @param string $login SSH Login to authenticate with
		* @param string $password SSH Password to authenticate with
		* @return bool
		*/
		function __construct($host, $port, $authinfo)
		{
			parent::__construct();
			
			// Default values
			$this->InstallPath = ZEUS_INSTALL_ROOT;
			
			$this->Authinfo = $authinfo;
			
			// SSH2
			$this->SSH2 = new SSH2();
						
			if ($this->Authinfo["type"] == "password")
				$this->SSH2->AddPassword($this->Authinfo["login"], $this->Authinfo["password"]);
			elseif ($this->Authinfo["type"] == "pubkey")
				$this->SSH2->AddPubkey($this->Authinfo["login"], $this->Authinfo["pubkey_path"], $this->Authinfo["privkey_path"], $this->Authinfo["key_pass"]);
			
			$this->SSH2->Connect($host, $port);
				
			if ($this->SSH2->IsConnected())
			{
    			// CD to install path
    			$exec = $this->SSH2->Exec("cd ".$this->InstallPath."/webadmin/bin && pwd");
    			
    			if (stristr($exec, "No such file"))
    			{
    				$this->RaiseWarning("{$this->InstallPath}/webadmin/bin - not found");
    				$this->IsInit = false;
    			}
    			else 
                    $this->IsInit = true;
			}
			else 
                $this->IsInit = false;
		}
Ejemplo n.º 10
0
 public function __construct()
 {
     parent::__construct();
     if ($this->config->nf_http_authentication && is_null($this->session('user_id')) && $this->session('session', 'http_authentication')) {
         $this->session->destroy('session', 'http_authentication');
         if (isset($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW'])) {
             $login = $_SERVER['PHP_AUTH_USER'];
             $password = $_SERVER['PHP_AUTH_PW'];
         } else {
             if (isset($_SERVER['REDIRECT_REMOTE_USER']) && preg_match('/Basic (.*)/', $_SERVER['REDIRECT_REMOTE_USER'], $matches)) {
                 list($login, $password) = explode(':', base64_decode($matches[1]));
             }
         }
         if (isset($login, $password)) {
             $user = $this->db->select('user_id', 'password', 'salt')->from('nf_users')->where('last_activity_date <>', 0)->where('deleted', FALSE)->where('BINARY username', $login, 'OR', 'BINARY email', $login)->row();
             if ($user) {
                 if (!$user['salt'] && $this->load->library('password')->is_valid($password, $user['password'], FALSE)) {
                     $this->db->where('user_id', (int) $user['user_id'])->update('nf_users', array('password' => $user['password'] = $this->password->encrypt($password . ($salt = unique_id())), 'salt' => $user['salt'] = $salt));
                 }
                 if ($this->load->library('password')->is_valid($password . $user['salt'], $user['password'])) {
                     $this->login((int) $user['user_id'], FALSE);
                     if ($this->config->request_url == 'user/logout.html') {
                         redirect();
                     }
                 }
             }
         }
     }
     $this->_init();
 }
Ejemplo n.º 11
0
 public function __construct()
 {
     parent::__construct();
     $this->db->where('remember_me', FALSE)->where('UNIX_TIMESTAMP(last_activity) <', time() - strtoseconds($this->config->nf_cookie_expire))->delete('nf_sessions');
     $this->_ip_address = isset($_SERVER['HTTP_X_REAL_IP']) ? $_SERVER['HTTP_X_REAL_IP'] : $_SERVER['REMOTE_ADDR'];
     $this->_host_name = utf8_string(gethostbyaddr($this->_ip_address));
     if (isset($_COOKIE[$this->config->nf_cookie_name]) && $this->_check_cookie($cookie = $_COOKIE[$this->config->nf_cookie_name], $last_activity)) {
         if (strtotime($this->config->nf_cookie_expire, $last_activity) < time()) {
             $this->_session_id();
         } else {
             $this->_session_id = $cookie;
         }
         $this->db->where('session_id', $cookie)->update('nf_sessions', array('session_id' => $this->_session_id, 'ip_address' => $this->_ip_address, 'host_name' => $this->_host_name, 'last_activity' => now()));
         if (!is_null($time_zone = $this('session', 'time_zone'))) {
             set_time_zone($time_zone);
             $this->db->update_time_zone();
         }
     } else {
         if (!is_asset() && !$this->config->ajax_url && !$this->config->ajax_header && $_SERVER['REQUEST_METHOD'] != 'OPTIONS') {
             $this->_session_id();
             $crawler = is_crawler();
             if ($crawler !== FALSE) {
                 $this->db->insert('nf_crawlers', array('name' => $crawler, 'path' => $this->config->request_url));
             }
             $this->db->insert('nf_sessions', array('session_id' => $this->_session_id, 'ip_address' => $this->_ip_address, 'host_name' => $this->_host_name, 'is_crawler' => $crawler !== FALSE));
             $this->_user_data['session']['date'] = time();
             $this->_user_data['session']['javascript'] = FALSE;
             $this->_user_data['session']['referer'] = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
             $this->_user_data['session']['user_agent'] = $_SERVER['HTTP_USER_AGENT'];
         }
     }
     statistics('nf_sessions_max_simultaneous', $this->_sessions = $this->db->select('COUNT(DISTINCT IFNULL(user_id, session_id))')->from('nf_sessions')->where('last_activity > DATE_SUB(NOW(), INTERVAL 5 MINUTE)')->where('is_crawler', FALSE)->row(), function ($a, $b) {
         return $a > $b;
     });
 }
Ejemplo n.º 12
0
 public function __construct()
 {
     parent::__construct();
     foreach ($this->db->from('nf_settings_addons')->get() as $addon) {
         $this->_addons[$addon['type']][$addon['name']] = (bool) $addon['enable'];
     }
 }
 function __construct($data)
 {
     parent::__construct($data);
     $this->setPrerequisites('userid,lat,lng,alignment,transport');
     if ($this->checkPrerequisites()) {
         $this->addPoint();
     }
 }
Ejemplo n.º 14
0
 public function __construct()
 {
     // initialisation du CORE
     parent::__construct();
     $class = self::$curent_class;
     // appel du controlleur
     echo $class::{Request::getController() . 'Controller'}();
 }
 function __construct($data)
 {
     parent::__construct($data);
     $this->setPrerequisites('lat,lng,yandex_id,text');
     if ($this->checkPrerequisites()) {
         $this->addPoint();
     }
 }
 function __construct()
 {
     parent::__construct();
     //$this->load->model('admincore_model');
     if (!$this->session->userdata('username')) {
         redirect('login');
     }
 }
Ejemplo n.º 17
0
 /**
  * Login constructor.
  */
 public function __construct()
 {
     parent::__construct();
     if (!isset($_SESSION[ADVANCEDLOGINSCRIPT_MESSAGE_KEY])) {
         $_SESSION[ADVANCEDLOGINSCRIPT_MESSAGE_KEY] = array();
     }
     $this->checkLoggedIn();
 }
Ejemplo n.º 18
0
		/**
		* Get filesystem mount points
		* @access public
		* @return array Mounts
		*/
		function __construct()
		{
			parent::__construct();
			//$this->Shell = Core::GetShellInstance();
			//$this->DB = Core::GetDBInstance();
			//$this->Smarty = Core::GetSmartyInstance();
			//$this->Validator = Core::GetValidatorInstance();
		}
Ejemplo n.º 19
0
 function __construct($hCore)
 {
     // Debug - Classname ausgeben?!
     $this->debugInitOnLoad('Class', $this->getClassName(false));
     // Speichere das Öffentliche hCore - Objekt zur weiteren Verwendung lokal
     $this->hCore = $hCore;
     parent::__construct();
 }
Ejemplo n.º 20
0
 /**
  * Constructor, load parent constructor
  */
 protected function __construct()
 {
     parent::__construct();
     //* Disable Genesis SEO.
     add_filter('genesis_detect_seo_plugins', array($this, 'disable_genesis_seo'), 10, 1);
     //* Disable Headway SEO.
     add_filter('headway_seo_disabled', '__return_true');
 }
Ejemplo n.º 21
0
 public function __construct()
 {
     parent::__construct();
     // Your own constructor code
     //config page rend
     $this->load->model('md_career');
     $this->_setMainPage($this->main_page);
 }
Ejemplo n.º 22
0
 function __construct()
 {
     parent::__construct();
     $this->Shell = ShellFactory::GetShellInstance();
     $this->Validator = Core::GetValidatorInstance();
     $this->OpenSSL = CF_ENV_OPENSSL;
     $this->SSLRoot = CF_ENV_HOMEROOT . "/" . CF_ENV_HOMENAME . "/" . CF_ENV_SSLROOT;
     $this->Date = date("j-n-Y");
 }
Ejemplo n.º 23
0
 /**
  * ZipArchive constructor
  */
 public function __construct()
 {
     parent::__construct();
     $this->MaxFilesInArchive = self::MaxFilesInArchive;
     $this->Files = array();
     $this->CompressedData = array();
     $this->CentralDirectory = array();
     $this->OldOffset = 0;
 }
Ejemplo n.º 24
0
 public function __construct()
 {
     parent::__construct('UPLOAD');
     $this->allow_size = isset($this->allow_size) ? $this->allow_size : 2097152;
     $this->allow_ext = isset($this->allow_ext) ? $this->allow_ext : array('jpg', 'gif', 'png', 'jpeg');
     $this->save_path = isset($this->save_path) ? $this->save_path : './Upload/' . date('Ymd') . '/';
     $this->save_name = isset($this->save_name) ? $this->save_name : $this->hash(date('YmdHis'));
     $this->file_field = isset($this->file_field) ? $this->file_field : 'file';
 }
Ejemplo n.º 25
0
 /**
  * Class Constructor
  * @ignore 
  */
 public function __construct($email = null)
 {
     parent::__construct();
     if (is_null($email)) {
         $email = self::LOG_EMAIL_RECIPIENT;
     }
     $this->EmailRecipient = $email;
     return true;
 }
Ejemplo n.º 26
0
 public function __construct($modx, array $cfg)
 {
     parent::__construct($modx, $cfg);
     $this->user = $this->loadModel($this->getCFGDef('model', '\\modUsers'), $this->getCFGDef('modelPath', 'assets/lib/MODxAPI/modUsers.php'));
     $lang = $this->lexicon->loadLang('login');
     if ($lang) {
         $this->log('Lexicon loaded', array('lexicon' => $lang));
     }
 }
Ejemplo n.º 27
0
 public function __construct()
 {
     parent::__construct();
     // Your own constructor code
     //config page rend
     $this->load->helper('form');
     $this->load->model('md_product');
     $this->_setMainPage($this->main_page);
 }
Ejemplo n.º 28
0
 public function __construct()
 {
     parent::__construct();
     $logger = new Logger();
     if (!$logger->user_logged_in()) {
         header('Location: /login');
     }
     $this->set_main_template("admin-main");
 }
Ejemplo n.º 29
0
        /**
         * @ignore
         *
         */
		function __construct()
		{
			parent::__construct();
			$this->Smarty = Core::GetSmartyInstance();
			
			// Assign configs
			$this->SetConfPath(CF_ENV_HTTPDCONF);
			$this->SetVHostTemplate(CF_HTTPD_VHOST_TEMPLATE);
			$this->SetVHostTemplate(CF_HTTPD_VHOST_SSL_TEMPLATE, true);
		}
Ejemplo n.º 30
0
 /**
  * Constructor
  *
  * @param string $search
  */
 function __construct($search = false)
 {
     parent::__construct();
     $this->DB = Core::GetDBInstance();
     $this->SearchString = $search;
     $this->XML = new DOMDocument();
     $this->XML->loadXML("<?xml version=\"1.0\" encoding=\"UTF-8\"?><menu></menu>");
     $this->XML->formatOutput = true;
     $this->XPath = new DOMXPath($this->XML);
 }