Ejemplo n.º 1
0
 public function __construct()
 {
     // Construct any possible parent, parse the configuration while doing that;
     parent::__construct();
     // Tie in common configuration data;
     $this->tieInCommonConfiguration();
     // Set the proper configuration options for this object;
     self::$objAuthUsersTable = $this->getConfigKey(new S('authentication_users_table'));
     self::$objAuthUsersTableFId = $this->getConfigKey(new S('authentication_users_table_field_id'));
     self::$objAuthUsersTableFUName = $this->getConfigKey(new S('authentication_users_table_field_username'));
     self::$objAuthUsersTableFUPass = $this->getConfigKey(new S('authentication_users_table_field_password'));
     self::$objAuthUsersTableFEML = $this->getConfigKey(new S('authentication_users_table_field_email'));
     self::$objAuthUsersTableFPhone = $this->getConfigKey(new S('authentication_users_table_field_phone'));
     self::$objAuthUsersTableFFName = $this->getConfigKey(new S('authentication_users_table_field_first_name'));
     self::$objAuthUsersTableFLName = $this->getConfigKey(new S('authentication_users_table_field_last_name'));
     self::$objAuthUsersTableFUGId = $this->getConfigKey(new S('authentication_users_table_field_group_id'));
     self::$objAuthUsersTableFRegOn = $this->getConfigKey(new S('authentication_users_table_field_registered_on'));
     self::$objAuthUsersTableFLastLog = $this->getConfigKey(new S('authentication_users_table_field_visited_on'));
     self::$objAuthUsersTableFHash = $this->getConfigKey(new S('authentication_users_table_field_hash'));
     self::$objAuthUsersTableFActivated = $this->getConfigKey(new S('authentication_users_table_field_activated'));
     self::$objAuthUsersTableFCountry = $this->getConfigKey(new S('authentication_users_table_field_country'));
     self::$objAuthUsersTableFSignature = $this->getConfigKey(new S('authentication_users_table_field_signature'));
     self::$objAuthUsersTableFDesc = $this->getConfigKey(new S('authentication_users_table_field_description'));
     self::$objAuthUsersTableFYM = $this->getConfigKey(new S('authentication_users_table_field_ym'));
     self::$objAuthUsersTableFMSN = $this->getConfigKey(new S('authentication_users_table_field_msn'));
     self::$objAuthUsersTableFICQ = $this->getConfigKey(new S('authentication_users_table_field_icq'));
     self::$objAuthUsersTableFAOL = $this->getConfigKey(new S('authentication_users_table_field_aol'));
     self::$objAuthUsersTableFCity = $this->getConfigKey(new S('authentication_users_table_field_city'));
     self::$objAuthUsersTableFAvatar = $this->getConfigKey(new S('authentication_users_table_field_avatar'));
     self::$objAuthUsersTableFIp = $this->getConfigKey(new S('authentication_users_table_field_ip'));
     // Groups ...
     self::$objAuthGroupTable = $this->getConfigKey(new S('authentication_group_table'));
     self::$objAuthGroupTableFId = $this->getConfigKey(new S('authentication_group_table_field_id'));
     self::$objAuthGroupTableFName = $this->getConfigKey(new S('authentication_group_table_field_name'));
     self::$objAuthGroupTableFSEO = $this->getConfigKey(new S('authentication_group_table_field_seo'));
     // Zones ...
     self::$objAuthZonesTable = $this->getConfigKey(new S('authentication_zones_table'));
     self::$objAuthZonesTableFId = $this->getConfigKey(new S('authentication_zones_table_field_id'));
     self::$objAuthZonesTableFName = $this->getConfigKey(new S('authentication_zones_table_field_name'));
     self::$objAuthZonesTableFDesc = $this->getConfigKey(new S('authentication_zones_table_field_description'));
     self::$objAuthZonesTableFPrice = $this->getConfigKey(new S('authentication_zones_table_field_price'));
     // Zone mappings ...
     self::$objAuthZoneMTable = $this->getConfigKey(new S('authentication_gtozm_table'));
     self::$objAuthZoneMTableFId = $this->getConfigKey(new S('authentication_gtozm_table_field_id'));
     self::$objAuthZoneMTableFZId = $this->getConfigKey(new S('authentication_gtozm_table_field_zone_id'));
     self::$objAuthZoneMTableFUGId = $this->getConfigKey(new S('authentication_gtozm_table_field_ug_id'));
     self::$objAuthZoneMTableFIUG = $this->getConfigKey(new S('authentication_gtozm_table_field_is_group'));
     self::$objAuthZoneMTableFAorD = $this->getConfigKey(new S('authentication_gtozm_table_field_deny_or_allow'));
     self::$objAuthZoneMTableFErase = $this->getConfigKey(new S('authentication_gtozm_table_field_eraseable'));
     // Configuration ...
     self::$objAuthDefaultGroup = $this->getConfigKey(new S('authentication_default_group'));
     self::$objAuthDefaultUsername = $this->getConfigKey(new S('authentication_default_admin_username'));
     self::$objAuthDefaultPassword = $this->getConfigKey(new S('authentication_default_admin_password'));
     // DB: Auto-CREATE:
     $objQueryDB = new FileContent($this->getPathToModule()->toRelativePath() . _S . CFG_DIR . _S . __CLASS__ . SCH_EXTENSION);
     // Make a FOREACH on each ...
     foreach (_S($objQueryDB->toString())->fromStringToArray(RA_SCHEMA_HASH_TAG) as $k => $v) {
         // Make'em ...
         $this->_Q(_S($v));
     }
     // Check non-modified user data, to prevent hackers;
     if ($this->checkIfUserIsLoggedIn()->toBoolean() == TRUE) {
         $this->checkIfUserDataIsOK();
     }
     // Get an MPTT Object, build the ROOT, make sure the table is OK;
     self::$objMPTT = new MPTT(self::$objAuthGroupTable, self::$objAuthDefaultGroup);
     self::$objMPTTForZones = new MPTT(self::$objAuthZonesTable, $this->getObjectCLASS());
     // Load'em defaults ... ATH, STG and others ...
     $this->STG = MOD::activateModule(new FilePath('mod/settings'), new B(TRUE));
     // Check that the default administrator user exists, or create it;
     $this->setDefaultAdministratorSettings();
     // Check to see if this zone exists, and if not, add it;
     if ($this->checkZoneByName(new S(__CLASS__))->toBoolean() == FALSE) {
         $this->doMakeZone(new S(__CLASS__), self::$objAuthZonesTableFName);
     }
     if ($this->checkAdministratorIsMappedToZone($this->getObjectCLASS())->toBoolean() == FALSE) {
         $this->doMapAdministratorToZone($this->getObjectCLASS());
     }
     // Do the tie, with myself, just for sub-zones;
     $this->tieInWithAuthentication($this);
 }