index b5852d5cde62ae27e0c1ee432774f0ef52e2478e..f1708574f358fb7f25ebdb04ebfa4aa0e22ea60b 100644 (file)
}
/* Objects */
- $tmp= session::get('plist');
+ $tmp= session::global_get('plist');
$plist= $tmp->info;
$cats = array();
if (isset($this->parent) && $this->parent !== NULL){
/* Call parent execute */
plugin::execute();
- $tmp= session::get('plist');
+ $tmp= session::global_get('plist');
$plist= $tmp->info;
/* Handle posts */
$aclDialog= FALSE;
$firstedit= FALSE;
+ /* Act on HTML post and gets here.
+ */
+ if(isset($_GET['id']) && isset($_GET['act']) && $_GET['act'] == "edit"){
+ $id = trim($_GET['id']);
+ $this->dialogState= 'create';
+ $firstedit= TRUE;
+ $this->dialog= TRUE;
+ $this->currentIndex= $id;
+ $this->loadAclEntry();
+ }
+
foreach($_POST as $name => $post){
/* Actions... */
if(!$this->acl_is_readable("")) continue;
$action ="";
+
+ if($this->acl_is_readable("")){
+ $link = "<a href=?plug=".$_GET['plug']."&id=".$key."&act=edit>".$this->assembleAclSummary($entry)."</a>";
+ }else{
+ $link = $this->assembleAclSummary($entry);
+ }
$field1= array("string" => $this->aclTypes[$entry['type']], "attach" => "style='width:150px'");
- $field2= array("string" => $this->assembleAclSummary($entry));
+ $field2= array("string" => $link);
if($this->acl_is_writeable("")){
$action.= "<input type='image' name='sortup_$key' alt='up'
function sort_by_priority($list)
{
- $tmp= session::get('plist');
+ $tmp= session::global_get('plist');
$plist= $tmp->info;
asort($plist);
$newSort = array();
{
$display= "<input type='hidden' name='acl_dummy_0_0_0' value='1'>";
$cols= 3;
- $tmp= session::get('plist');
+ $tmp= session::global_get('plist');
$plist= $tmp->info;
asort($plist);
/* Create sub acl if it does not exist */
if (!isset($this->aclContents[$key])){
$this->aclContents[$key]= array();
+ }
+ if(!isset($this->aclContents[$key][0])){
$this->aclContents[$key][0]= '';
}
+
$currentAcl= $this->aclContents[$key];
/* Get the overall plugin acls
$overall_acl = $currentAcl[0];
}
+ // Detect configured plugins
+ $expand = count($currentAcl) > 1 || $currentAcl[0] != "";
+
/* Object header */
$tname= preg_replace("/[^a-z0-9]/i","_",$name);
- if(session::get('js')) {
- if(isset($_SERVER['HTTP_USER_AGENT']) && preg_match("/gecko/i",$_SERVER['HTTP_USER_AGENT'])) {
+
+ if($expand){
+ $back_color = "#C8C8FF";
+ }else{
+ $back_color = "#C8C8C8";
+ }
+
+ if(session::global_get('js')) {
+ if(isset($_SERVER['HTTP_USER_AGENT']) &&
+ (preg_match("/gecko/i",$_SERVER['HTTP_USER_AGENT'])) ||
+ (preg_match("/presto/i",$_SERVER['HTTP_USER_AGENT']))) {
$display.= "\n<table style='width:100%;border:1px solid #A0A0A0' cellspacing=0 cellpadding=2>".
"\n <tr>".
- "\n <td style='background-color:#C8C8C8;height:1.8em;' colspan=".($cols-1)."><b>"._("Object").": $name</b></td>".
- "\n <td align='right' style='background-color:#C8C8C8;height:1.8em;'>".
+ "\n <td style='background-color:{$back_color};height:1.8em;' colspan=".($cols-1)."><b>"._("Object").": $name</b></td>".
+ "\n <td align='right' style='background-color:{$back_color};height:1.8em;'>".
"\n <input type='button' onclick='divtoggle(\"$tname\");' value='"._("Show/hide advanced settings")."' /></td>".
"\n </tr>";
} else if (isset($_SERVER['HTTP_USER_AGENT']) && preg_match("/ie/i",$_SERVER['HTTP_USER_AGENT'])) {
/* Walk through the list of attributes */
$cnt= 1;
$splist= $plist[preg_replace('%^.*/%', '', $key)]['plProvidedAcls'];
-# asort($splist);
- if(session::get('js')) {
- if(isset($_SERVER['HTTP_USER_AGENT']) && preg_match("/gecko/i",$_SERVER['HTTP_USER_AGENT'])) {
+ if(session::global_get('js')) {
+ if(isset($_SERVER['HTTP_USER_AGENT']) &&
+ (preg_match("/gecko/i",$_SERVER['HTTP_USER_AGENT'])) || (preg_match("/presto/i",$_SERVER['HTTP_USER_AGENT']))) {
$display.= "\n <tr id='tr_$tname' style='vertical-align:top;height:0px;'>".
"\n <td colspan=".$cols.">".
"\n <div id='$tname' style='overflow:hidden;visibility:hidden;height:0px;vertical-align:top;width:100%;'>".
"\n <td colspan=".$cols.">".
"\n <div id='$tname' style='position:absolute;overflow:hidden;visibility:hidden;height:0px;vertical-align:top;width:100%;'>".
"\n <table style='width:100%;'>";
+ }else{
}
}
+
+
foreach($splist as $attr => $dsc){
/* Skip pl* attributes, they are internal... */
$display.= str_repeat("\n <td style='border-top:1px solid #A0A0A0; width:".(int)(100/$cols)."%'> </td>", $cols-$cnt);
}
- if(session::get('js')) {
- if(isset($_SERVER['HTTP_USER_AGENT']) && (preg_match("/gecko/i",$_SERVER['HTTP_USER_AGENT'])) || (preg_match("/ie/i",$_SERVER['HTTP_USER_AGENT']))) {
+ if(session::global_get('js')) {
+ if(isset($_SERVER['HTTP_USER_AGENT']) &&
+ (preg_match("/gecko/i",$_SERVER['HTTP_USER_AGENT'])) ||
+ (preg_match("/presto/i",$_SERVER['HTTP_USER_AGENT'])) ||
+ (preg_match("/ie/i",$_SERVER['HTTP_USER_AGENT']))) {
$display.= "\n </table>".
"\n </div>".
"\n </td>".
}
if (!$ldap->success()){
- msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class()));
+ msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class()), ERROR_DIALOG);
}
/* Refresh users ACLs */
$ui= get_userinfo();
$ui->loadACL();
- session::set('ui',$ui);
+ session::global_set('ui',$ui);
}