Horde::url('view.php?view=List', true)->redirect();
exit;
} else {
- $_SESSION['ansel']['user_age'] = (int)$gallery->get('age');
+ $session->set('ansel', 'user_age', (int)$gallery->get('age'));
$url->redirect();
exit;
}
);
/* Use ajax? */
- if (!isset($_SESSION['ansel']['ajax_locationac'])) {
+ if (!$GLOBALS['session']->exists('ansel', 'ajax_locationac')) {
$results = $GLOBALS['injector']->getInstance('Ansel_Injector_Factory_Storage')->create()->searchLocations();
if ($results instanceof PEAR_Error) {
Horde::logMessage($results, 'ERR');
} else {
- $_SESSION['ansel']['ajax_locationac'] = (count($results) > 50);
+ $GLOBALS['session']->set('ansel', 'ajax_locationac', (count($results) > 50));
}
}
- if (!empty($_SESSION['ansel']['ajax_locationac'])) {
+ if ($GLOBALS['session']->get('ansel', 'ajax_locationac')) {
$ret['ajax'] = 'LocationAutoCompleter';
} else {
if (empty($results)) {
*/
public function isOldEnough()
{
+ global $session;
+
if (($GLOBALS['registry']->getAuth() &&
$this->data['share_owner'] == $GLOBALS['registry']->getAuth()) ||
empty($GLOBALS['conf']['ages']['limits']) ||
}
// Do we have the user age already cheked?
- if (!isset($_SESSION['ansel']['user_age'])) {
- $_SESSION['ansel']['user_age'] = 0;
- } elseif ($_SESSION['ansel']['user_age'] >= $this->data['attribute_age']) {
- return true;
+ if (!$session->exists('ansel', 'user_age')) {
+ $session->set('ansel', 'user_age', 0);
+ $user_age = 0;
+ } else {
+ $user_age = $session->get('ansel', 'user_age');
+ if ($user_age >= $this->data['attribute_age']) {
+ return true;
+ }
}
// Can we hook user's age?
$GLOBALS['registry']->isAuthenticated()) {
$result = Horde::callHook('_ansel_hook_user_age');
if (is_int($result)) {
- $_SESSION['ansel']['user_age'] = $result;
+ $session->set('ansel', 'user_age', $result);
+ $user_age = $result;
}
}
- return ($_SESSION['ansel']['user_age'] >= $this->data['attribute_age']);
+ return ($user_age >= $this->data['attribute_age']);
}
/**
}
$passwd = $this->get('passwd');
- if (empty($passwd) ||
- (!empty($_SESSION['ansel']['passwd'][$this->id])
- && $_SESSION['ansel']['passwd'][$this->id] = md5($this->get('passwd')))) {
+ if (empty($passwd)) {
+ return false;
+ } elseif ($GLOBALS['session']->get('ansel', 'passwd/' . $this->id)) {
+ $GLOBALS['session']->set('ansel', 'passwd/' . $this->id, hash('md5', $this->get('passwd')));
return false;
}
*/
function save()
{
- $_SESSION['ansel_search'][$this->_type] = $this->_filter;
+ $GLOBALS['session']->set('ansel', 'search/' . $this->_type, $this->_filter);
}
/**
*/
function load()
{
- $this->_filter = (!empty($_SESSION['ansel_search'][$this->_type]) ?
- $_SESSION['ansel_search'][$this->_type] :
- array());
+ $this->_filter = $GLOBALS['session']->get('ansel', 'search/' . $this->_type, Horde_Session::TYPE_ARRAY);
}
/**
* retrieve a slice of the current search
if (!empty($tags)) {
$this->_tags = $this->_tagger->getTagIds($tags);
} else {
- $this->_tags = (!empty($_SESSION['ansel_tags_search']) ? $_SESSION['ansel_tags_search'] : array());
+ $this->_tags = $GLOBALS['session']->get('ansel', 'tags_search', Horde_Session::TYPE_ARRAY);
}
$this->_owner = $owner;
*/
public function save()
{
- $_SESSION['ansel_tags_search'] = $this->_tags;
+ $GLOBALS['session']->set('ansel', 'tags_search', $this->_tags);
$this->_dirty = false;
}
*/
static public function clearSearch()
{
- unset($_SESSION['ansel_tags_search']);
+ $GLOBALS['session']->remove('ansel', 'tags_search');
}
/**
return $a['total'] < $b['total'];
}
-}
\ No newline at end of file
+}
if ($gallery->get('passwd') != $vars->get('passwd')) {
$notification->push(_("Incorrect password"), 'horde.warning');
} else {
- $_SESSION['ansel']['passwd'][$gallery->id] = md5($vars->get('passwd'));
+ $session->set('ansel', 'passwd/' . $gallery->id, hash('md5', $vars->get('passwd')));
$url = $vars->get('url');
if (empty($url)) {
$url = Horde::url('view.php')->add('gallery', $gallery->id);