/** * If any user parameters were stored prior to a redirect, get them, put them * in our user parameters array and then unset the session variable * @access private */ private function fetchRedirectedParameters() { if (Session::isRegistered('redirected_user_parameters')) { $this->user_params = Session::getRegistered('redirected_user_parameters'); foreach ($this->user_params as $name => $param) { $_POST[$name] = $param; } Session::unRegister('redirected_user_parameters'); } }
/** * Delete all objects * * This creates a single delete query using the complete keys of * each of the dbobjects that has been registered */ function delete() { if (count($this->dbobjects) && is_array($this->dbobjects)) { $clause = new Clause(); $class_name = $this->class_name; $obj = new $class_name(); DbObject::cascadeDelete($this->dbobjects); foreach ($this->dbobjects as $dbobj) { /**$sub_clause = new Clause(); foreach($dbobj->primaryKeys() as $field) { $sub_clause->addTableCondition($obj->tableName(),$field->name(),$field->value()); }*/ if ($dbobj->db_clause) { $clause->addSubClause($dbobj->db_clause, Clause::OR_REL, Clause::LAST); } else { $clause->addSubClause($dbobj->uniqueClause(), Clause::OR_REL, Clause::LAST); } } $query = new DeleteQuery($obj->tableName()); $query->setClause($clause); Session::unRegister($this->class_name . '_rel_deleteregister'); $query->doQuery(); } }
public function endImpersonation() { $not_impersonated = Session::getRegistered('not_impersonated_user'); Application::setUser($not_impersonated); SiteNavigation::init($not_impersonated->getHandlerTree()); Session::unRegister('not_impersonated_user'); }