summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b7db512)
raw | patch | inline | side by side (parent: b7db512)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 3 Jan 2008 14:41:11 +0000 (14:41 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 3 Jan 2008 14:41:11 +0000 (14:41 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8196 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/plugins/addons/addressbook/class_addressbook.inc | patch | blob | history | |
gosa-core/plugins/addons/addressbook/main.inc | patch | blob | history |
diff --git a/gosa-core/plugins/addons/addressbook/class_addressbook.inc b/gosa-core/plugins/addons/addressbook/class_addressbook.inc
index 67bb3455e734bb5dbffcef79222cf54d618f0daa..0f41b3097999d4af5764805bd9fdf60d91c4e35f 100644 (file)
}
/* Save to session */
- $_SESSION['source']= $source;
- $_SESSION['target']= $target;
+ session::set('source',$source);
+ session::set('target',$target);
/* Perform call */
if ($target != "" && $source != ""){
}
/* Finally dial */
- if (isset($_POST['dial']) && isset($_SESSION['source']) && isset($_SESSION['target'])){
- exec ($this->config->current['CTIHOOK']." '".$_SESSION['source']."' '".$_SESSION['target']."'", $dummy, $retval);
- unset($_SESSION['source']);
- unset($_SESSION['target']);
+ if (isset($_POST['dial']) && session::is_set('source') && session::is_set('target')){
+ exec ($this->config->current['CTIHOOK']." '".session::get('source')."' '".session::get('target')."'", $dummy, $retval);
+ session::un_set('source');
+ session::un_set('target');
}
del_lock ($this->dn);
/* Clean up */
- if (isset($_SESSION['saved_start'])){
- $_GET['start']= $_SESSION['saved_start'];
+ if (session::is_set('saved_start')){
+ $_GET['start']= session::get('saved_start');
}
- unset($_SESSION['show_info']);
- unset($_SESSION['saved_start']);
+ session::un_set('show_info');
+ session::un_set('saved_start');
}
$this->save();
/* Clean up */
- if (isset($_SESSION['saved_start'])){
- $_GET['start']= $_SESSION['saved_start'];
+ if (session::is_set('saved_start')){
+ $_GET['start']= session::get('saved_start');
}
- $_SESSION['show_info']= $this->dn;
- unset($_SESSION['saved_start']);
+ session::set('show_info',$this->dn);
+ session::un_set('saved_start');
} else {
/* Errors found, show message */
show_errors ($message);
/* Close info window */
if (isset($_GET['close']) || isset($_POST['cancel'])){
- if (isset($_SESSION['saved_start'])){
- $_GET['start']= $_SESSION['saved_start'];
+ if (session::is_set('saved_start')){
+ $_GET['start']= session::get('saved_start');
}
- unset($_SESSION['show_info']);
- unset($_SESSION['saved_start']);
+ session::un_set('show_info');
+ session::un_set('saved_start');
}
/* Start address book edit mode? */
if (isset($_GET['global'])){
- if (!isset($_SESSION['saved_start']) && isset($_GET['start'])){
- $_SESSION['saved_start']= $_GET['start'];
+ if (!session::is_set('saved_start') && isset($_GET['start'])){
+ session::set('saved_start',$_GET['start']);
}
switch ($_GET['global']){
case "add":
foreach ($this->attributes as $name){
$this->$name= "";
}
- $this->dn= $_SESSION['show_info'];
+ $this->dn= session::get('show_info');
$this->load();
$this->orig_cn= $this->cn;
break;
case "remove":
- $this->dn= $_SESSION['show_info'];
+ $this->dn= session::get('show_info');
$this->load();
/* Load permissions for selected 'dn' and check if
print_red (_("You are not allowed to delete this entry!"));
}
}
- $_SESSION['show_info']= "ADD";
+ session::set('show_info',"ADD");
}
/* Open info window */
if (isset($_GET['show'])){
- if (!isset($_SESSION['saved_start'])){
- $_SESSION['saved_start']= $_GET['start'];
+ if (!session::is_set('saved_start')){
+ session::set('saved_start',$_GET['start']);
}
$this->dn = base64_decode($_GET['show']);
$this->view_logged =FALSE;
$this->view_logged = TRUE;
new log("view","addressbook/".get_class($this),$this->dn);
}
- $_SESSION['show_info']= base64_decode($_GET['show']);
+ session::set('show_info',base64_decode($_GET['show']));
}
/* View detailed infos */
$smarty->assign("show_info", "");
- if (isset($_SESSION['show_info'])){
+ if (session::is_set('show_info')){
$range= 4;
$smarty->assign("show_info", "1");
$this->storage_base = $_POST['storage_base'];
}
- switch ($_SESSION['show_info']){
+ switch (session::get('show_info')){
case "ADD":
}
/* Fill variables from LDAP */
- if ($_SESSION['show_info'] != "ADD"){
- $ldap->cat($_SESSION['show_info'], $this->attributes);
+ if (session::get('show_info') != "ADD"){
+ $ldap->cat(session::get('show_info'), $this->attributes);
$info= $ldap->fetch();
}
foreach ($this->attributes as $name){
$smarty->assign("info_$name", "");
}else
- if ($_SESSION['show_info'] != "ADD" && isset($info["$name"][0])){
+ if (session::get('show_info') != "ADD" && isset($info["$name"][0])){
error_reporting(0);
/* Special treatment for phone attributes */
if ($name == "mobile" ||
$name == "homePhone" ||
$name == "telephoneNumber"){
$smarty->assign("info_$name",
- "<a title=\""._("Dial")." ".$info["$name"][0]."\" href=\"main.php?plug=".validate($_GET['plug'])."&dial=$name&start=".validate($_GET['start'])."&target=".base64_encode($_SESSION['show_info'])."\">".$info["$name"][0]."</a>");
+ "<a title=\""._("Dial")." ".$info["$name"][0]."\" href=\"main.php?plug=".validate($_GET['plug'])."&dial=$name&start=".validate($_GET['start'])."&target=".base64_encode(session::get('show_info'))."\">".$info["$name"][0]."</a>");
} else {
$smarty->assign("info_$name", preg_replace("/\n/", "<br>", $info["$name"][0]));
}
error_reporting(E_ALL | E_STRICT);
- } elseif ($_SESSION['show_info'] == "ADD" && isset($this->$name)) {
+ } elseif (session::get('show_info') == "ADD" && isset($this->$name)) {
$smarty->assign("info_$name", $this->$name);
} else {
$smarty->assign("info_$name", "-");
}
}
- if (preg_match("/,".$this->abobjectclass.",/", $_SESSION['show_info'])){
+ if (preg_match("/,".$this->abobjectclass.",/", session::get('show_info'))){
$storage= _("global addressbook");
$smarty->assign("internal", 0);
} else {
$storage= _("user database");
$smarty->assign("internal", 1);
}
- if ($_SESSION['show_info'] != "ADD"){
+ if (session::get('show_info') != "ADD"){
$smarty->assign("storage_info", sprintf(_("Contact stored in '%s'"), $storage));
} else {
$smarty->assign("storage_info", _("Creating new entry in"));
diff --git a/gosa-core/plugins/addons/addressbook/main.inc b/gosa-core/plugins/addons/addressbook/main.inc
index dbfd76022a893530233ff14a25a1c3f1bfcc1514..faa5ee56ab3cf3969cb115e1706547ee0c12f889 100644 (file)
if (!$remove_lock){
/* Create phonelist object on demand */
- if (!isset($_SESSION['addressbook']) || (isset($_GET['reset']) && $_GET['reset'] == 1)){
- $_SESSION['addressbook']= new addressbook ($config);
- $_SESSION['addressbook']->set_acl_base($ui->dn);
- $_SESSION['addressbook']->set_acl_category("addressbook");
- unset($_SESSION['show_info']);
+ if (!session::is_set('addressbook') || (isset($_GET['reset']) && $_GET['reset'] == 1)){
+ $addressbook = new addressbook ($config);
+ $addressbook -> set_acl_base($ui->dn);
+ $addressbook -> set_acl_category("addressbook");
+ session::set('addressbook',$addressbook);
+ session::un_set('show_info');
}
- $addressbook= $_SESSION['addressbook'];
+ $addressbook= session::get('addressbook');
/* Execute formular */
$display= $addressbook->execute ();
$display= print_header(get_template_path('images/addressbook.png'), _("Address book")).$display;
/* Store changes in session */
- $_SESSION['addressbook']= $addressbook;
+ session::set('addressbook',$addressbook);
}
?>