Exemple #1
0
 /**
  * Create and save an instance of the SysOps object
  *
  * Depending on the release of nessquik being used,
  * different libraries need to be loaded. This method
  * will create a single instance of the SysOps object.
  * The object created will be relevant to the release
  * of nessquik. This object can then be retrieved at
  * any time by re-calling the getInstance method
  *
  * @return object SysOps instance specific to the release
  */
 static function getInstance()
 {
     if (empty(self::$instance)) {
         switch (_RELEASE) {
             case "fermi":
                 if (!file_exists(_ABSPATH . '/lib/SysOpsFermi.php')) {
                     die("Fermi SysOps class does not exist");
                 }
                 require_once _ABSPATH . '/lib/SysOpsFermi.php';
                 self::$instance = new SysOpsFermi();
                 break;
             case "general":
             default:
                 if (!file_exists(_ABSPATH . '/lib/SysOpsGeneral.php')) {
                     die("General SysOps class does not exist");
                 }
                 require_once _ABSPATH . '/lib/SysOpsGeneral.php';
                 self::$instance = new SysOpsGeneral();
                 break;
         }
     }
     return self::$instance;
 }
Exemple #2
0
     * to logout and try resetting the dn
     */
    if ($client_dn == '') {
        $logout = true;
    }
    // Send them away to log out and log back in again if neccessary
    if ($logout) {
        header("Location: deps/nessquik-main/logout.php");
    }
} else {
    $_SESSION['username'] = "******";
}
$db = nessquikDB::getInstance();
$tpl = SmartyTemplate::getInstance();
$_usr = User::getInstance();
$_chk = SysOps::getInstance();
$_chk->check_version();
$sql = array('select' => "\tSELECT pluginid \n\t\t\tFROM plugins \n\t\t\tLIMIT 2", 'settings' => "\tINSERT INTO profile_settings(\n\t\t\t\t`username`,\n\t\t\t\t`profile_id`,\n\t\t\t\t`alternative_cgibin_list`) \n\t\t\tVALUES (':1',':2',':3');", 'select_settings' => "\tSELECT profile_id \n\t\t\t\tFROM profile_settings \n\t\t\t\tWHERE username='******' \n\t\t\t\tAND setting_type='sys';");
$username = import_var('username', 'S');
$division = $_usr->get_division_from_uid($username);
$division_id = $_usr->get_division_id($division);
$editor = false;
$has_whitelist = false;
$has_saved_scans = false;
$has_special_plugins = false;
$has_clusters = false;
$has_registered = false;
$stmt = $db->prepare($sql['select']);
$stmt3 = $db->prepare($sql['select_settings']);
$stmt4 = $db->prepare($sql['settings']);
$proper = $_usr->get_proper_name($username);