Exemplo n.º 1
0
 public static function load()
 {
     EProtect::$localkey = ELoader::$subsite_path . 'pwd';
     //ELoader::$subsite_path; cointains the actual caller of protect call
     //keep enabled as standard choice
     if (isset(EConfig::$data['generic']['enabled'])) {
         //case in which it is 'no' or anything different from 'yes' or 'protected'
         if (EConfig::$data['generic']['enabled'] != 'yes' and EConfig::$data['generic']['enabled'] != 'protected') {
             die('Access denied.');
         }
         //asks for password
         if (EConfig::$data['generic']['enabled'] == 'protected') {
             if (!EProtect::checklogin()) {
                 echo '<html>';
                 die(EProtect::loginform());
                 echo '</html>';
             }
         }
     }
 }
Exemplo n.º 2
0
 public function logout()
 {
     EProtect::logout();
 }
Exemplo n.º 3
0
    }
}
class EUnloader
{
    public function __destruct()
    {
        EDatabase::unload();
    }
}
$unloader = new EUnloader();
//including all modules
ELoader::loadAllModules();
//loading current website configuration
EConfig::load();
//protecting whole website with auth and enabled
EProtect::load();
//rewrite url if needed
if (EConfig::$data['generic']['rewrite'] == "yes") {
    ERewriter::enable();
    ERewriter::load();
} else {
    ERewriter::disable();
}
//loading get/post
if (EConfig::$data['generic']['protectheaders'] == "yes") {
    EHeaderDataParser::load();
}
//loading database
if (EConfig::$data['generic']['database'] == "yes") {
    EDatabase::load();
}