index 0d1ea42a6652df1d9a77581eaf6810277d112c21..ed4eb8a8212ffb4f3983c9227d389c744842ff4e 100644 (file)
var $subClassName = "faiTemplateEntry";
/* Attributes to initialise for each subObject */
- var $subAttributes = array("cn","description","FAItemplateFile","FAItemplatePath");
- var $sub64coded = array("FAItemplateFile","FAItemplatePath");
+ var $subAttributes = array("cn","description","FAItemplateFile","FAItemplatePath","FAIowner","FAImode");
+ var $sub64coded = array();
/* Specific attributes */
var $cn = ""; // The class name for this object
}
foreach($this->sub64coded as $codeIt){
- $this->SubObjects[$object['cn'][0]][$codeIt]=base64_decode($this->SubObjects[$object['cn'][0]][$codeIt]);
+ $this->SubObjects[$object['cn'][0]][$codeIt]= base64_decode($this->SubObjects[$object['cn'][0]][$codeIt]);
}
- $this->SubObjects[$object['cn'][0]]['FAItemplateFile'] =base64_decode($this->readBinary("FAItemplateFile",$object['dn']));
+ $this->SubObjects[$object['cn'][0]]['FAItemplateFile']= $this->readBinary("FAItemplateFile",$object['dn']);
- $this->SubObjects[$object['cn'][0]]['status'] = "edited";
- $this->SubObjects[$object['cn'][0]]['dn'] = $object['dn'];
+ $this->SubObjects[$object['cn'][0]]['status']= "edited";
+ $this->SubObjects[$object['cn'][0]]['dn']= $object['dn'];
}
+ ksort($this->SubObjects);
}
}
function execute()
{
+ /* Call parent execute */
+ plugin::execute();
+
/* Fill templating stuff */
$smarty= get_smarty();
$display= "";
$this->is_dialog=true;
}
+ $_SESSION['objectinfo'] = $this->dn;
/* Edit selected Sub Object */
if((isset($_POST['EditSubObject']))&&(isset($_POST['SubObject']))){
$this->dialog= new $this->subClassName($this->config,$this->dn,$this->SubObjects[$_POST['SubObject']]);
+ $_SESSION['objectinfo'] = $this->SubObjects[$_POST['SubObject']]['dn'];
$this->is_dialog=true;
}
$this->is_dialog=false;
unset($this->dialog);
$this->dialog=NULL;
+ ksort($this->SubObjects);
}
}
$smarty->assign("SubObjects",$this->getList());
$smarty->assign("SubObjectKeys",array_flip($this->getList()));
- /* Assign variables */
+
+ /* Magic quotes GPC, escapes every ' " \, to solve some security risks
+ * If we post the escaped strings they will be escaped again
+ */
foreach($this->attributes as $attrs){
- $smarty->assign($attrs,$this->$attrs);
+ if(get_magic_quotes_gpc()){
+ $smarty->assign($attrs,stripslashes($this->$attrs));
+ }else{
+ $smarty->assign($attrs,($this->$attrs));
+ }
}
+
$display.= $smarty->fetch(get_template_path('faiTemplate.tpl', TRUE));
return($display);
}
*/
function save_object()
{
- plugin::save_object();
- foreach($this->attributes as $attrs){
- if(isset($_POST[$attrs])){
- $this->$attrs = $_POST[$attrs];
+ if(isset($_POST['FAItemplate_posted'])){
+ plugin::save_object();
+ foreach($this->attributes as $attrs){
+ if(isset($_POST[$attrs])){
+ $this->$attrs = $_POST[$attrs];
+ }
}
}
}
function check()
{
$message= array();
- $str = utf8_encode("üöä");
- if((preg_match("/[^a-z0-9".$str."\.,;:\-_\? ]/i",$this->description))){
- $message[]=_("Please enter a valid description.");
- }
return ($message);
}