예제 #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>';
             }
         }
     }
 }