public function set($section, $valor) { if (trim(session_id()) == "") { self::$instance = new self(); } $_SESSION[$section] = Crypt::encrypt($valor); }
public function __construct($dataBase = NULL) { if (is_null($dataBase)) { $dataBase = 'default'; } $_config = Reader::get('bases'); $base = $_config[$dataBase]; $base['password'] = Crypt::decrypt($base['password']); parent::connect($base); }
public function app_user($name, $email, $password) { include_once PATH_ROOT . '/app/Helpers/UsersAccount.php'; include_once PATH_ROOT . '/app/Models/Usuarios.php'; $class = 'UsersAccountHelper'; $helper = Singleton::get($class); $mdlUsuarios = Singleton::get('UsuariosModel'); $data = array('user' => $name, 'email' => $email, 'password' => $password); $userId = $helper->createUser($data); $data = Reader::get('bases'); $data = $data['default']; $data['password'] = trim(Crypt::decrypt($data['password'])); $db = new DataManager($data); $data = $db->query('SELECT MAX(userId) userId FROM __usersControl'); $userId = array_pop($data); $userId = $userId['userId']; echo 'Usuario creado ' . $userId . PHP_EOL; }