Пример #1
0
 /**
  * @param int $tablename name of table expressed as an integer,
  * 				e.g. MOD_enc::TABLE_NAME_REF_MEMBER
  * @param int $rownumber number of row in the table afore mentioned
  * @return void
  */
 public function __construct($tablename, $rownumber, $idMember, $keyMember)
 {
     $db = PVars::getObj('config_rdbms');
     if (!$db) {
         throw new PException('DB config error!');
     }
     $dao = PDB::get($db->dsn, $db->user, $db->password);
     $this->dao =& $dao;
     parent::__construct($tablename, $rownumber, $keyMember);
     $this->_idMember = $idMember;
 }
Пример #2
0
 private function initAdmin()
 {
     // file contains one line, e. g.
     // $key = 'xm4-s90.3kf1S9';
     require_once SCRIPT_BASE . 'inc/enckey.inc.php';
     if (empty($key)) {
         throw new PException('Security key missing!');
     }
     MOD_enc::$_cipherAndMode = mcrypt_module_open(MOD_enc::CIPHER, '', MOD_enc::MODE, '');
     MOD_enc::$_ivSize = mcrypt_enc_get_iv_size(MOD_enc::$_cipherAndMode);
     MOD_enc::$_keySize = mcrypt_enc_get_key_size(MOD_enc::$_cipherAndMode);
     MOD_enc::$_keyAdmin = substr($key, 0, MOD_enc::$_keySize);
 }