summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4edea63)
raw | patch | inline | side by side (parent: 4edea63)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 18 Oct 2006 07:53:04 +0000 (07:53 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 18 Oct 2006 07:53:04 +0000 (07:53 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4893 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/admin/fai/class_faiTemplate.inc | patch | blob | history | |
plugins/admin/fai/class_faiTemplateEntry.inc | patch | blob | history | |
plugins/admin/fai/faiTemplateEntry.tpl | patch | blob | history |
index dd364ccd1a77db288303eee814701cd69eb4bfa2..0c4fa51df2effc68ff5c0c9a0b2c13b199f3a09a 100644 (file)
$obj = $this->get_object_attributes($obj,$this->sub_Load_Later);
}
$this->dialog= new $this->subClassName($this->config,$this->dn,$obj);
+ $this->dialog->set_acl_base($this->acl_base);
+ $this->dialog->set_acl_category("fai");
+
$_SESSION['objectinfo'] = $obj['dn'];
$this->dialog->parent = &$this;
$this->is_dialog=true;
if(preg_match("/c/",$acl)){
$this->dialog= new $this->subClassName($this->config,"new");
+ $this->dialog->set_acl_base($this->acl_base);
+ $this->dialog->set_acl_category("fai");
$this->is_dialog=true;
}
}
if(empty($obj[$attrs])){
$obj[$attrs] = array();
}
- $tmp[$attrs] = stripslashes($obj[$attrs]);
+ $tmp[$attrs] =($obj[$attrs]);
}
$tmp['objectClass'] = $this->subClasses;
diff --git a/plugins/admin/fai/class_faiTemplateEntry.inc b/plugins/admin/fai/class_faiTemplateEntry.inc
index a2e9035dfc3cba4676456fa9b2a713259507bfcf..24bab5d1311f3d4239325e13b4e5de9c06ffd68d 100644 (file)
$this->user = explode( '.', $this->FAIowner );
$this->group = $this->user[1];
$this->user = $this->user[0];
+
$_SESSION['binary'] = $this->FAItemplateFile;
$_SESSION['binarytype'] = 'octet-stream';
$_SESSION['binaryfile'] = basename( $this->FAItemplatePath );
+
+ if(!empty($this->dn) && $this->dn != "new"){
+ $ldap = $this->config->get_ldap_link();
+ $_SESSION['binary'] =$ldap->get_attribute($this->dn,"FAItemplateFile");
+ $this->FAItemplateFile = $_SESSION['binary'];
+ }
$this->FAImode= sprintf("%0.4s", $this->FAImode)." ";
}
$smarty->assign("rand", rand(0, 10000));
$display = "";
- if(isset($_POST['TmpFileUpload'])){
+ if(isset($_POST['TmpFileUpload']) && $this->acl_is_writeable("FAItemplateFile")){
if($str=file_get_contents($_FILES['FAItemplateFile']['tmp_name'])){
$this->FAItemplateFile = $str;
$bStatus = false; // Hide download icon on default
if(strlen($this->FAItemplateFile)){
+
$status= sprintf(_("exists in database (size: %s bytes)"),strlen($this->FAItemplateFile));
$bStatus = true; // Display download icon
}
$smarty->assign("FAItemplateFile","");
foreach($this->attributes as $attr){
- if(($this->FAIstate == "freeze") || (chkacl($this->acl,$attr)!= "")){
- $smarty->assign($attr."ACL"," disabled ");
- }else{
- $smarty->assign($attr."ACL"," ");
- }
+ $smarty->assign($attr."ACL",$this->getacl($attr,preg_match("/freeze/",$this->FAIstate)));
}
$display.= "<h2><font color='red'>Fix / problen and ensure that size and content are correct if you download this template. Revision > 4582 (gosa-2.5 is already patched)</font></h2>".$smarty->fetch(get_template_path('faiTemplateEntry.tpl', TRUE));
index 4656e4964c7e5568497c4d0ad62d37571b1fa2a0..a047f7a2645bc888ebd15dbef3666c15ede9abe3 100644 (file)
<tr>
<td width="50%">
{t}Name{/t}{$must}
- <input value="{$cn}" name="cn" size="45" maxlength="80" {$cnACL}>
+{render acl=$cnACL}
+ <input value="{$cn}" name="cn" size="45" maxlength="80">
+{/render}
</td>
<td>
{t}Description{/t}
- <input size="45" maxlength="80" value="{$description}" name="description" {$descriptionACL}>
+{render acl=$descriptionACL}
+ <input size="45" maxlength="80" value="{$description}" name="description">
+{/render}
</td>
</tr>
</table>
<td style="vertical-align:top" class="center">
{$status}
{if $bStatus}
- <a href="getbin.php?rand={$rand}"><img class="center" alt="{t}Save template{/t}..." title="{t}Save template{/t}..." src="images/save.png" border="0" /></a>
+ <a href="getbin.php?rand={$rand}">
+ <img class="center" alt="{t}Save template{/t}..." title="{t}Save template{/t}..." src="images/save.png" border="0" />
+ </a>
{/if}
<br>
<br>
- <input type="file" name="FAItemplateFile" value="{$FAItemplateFile}" id="FAItemplateFile" {$FAItemplateFileACL}>
- <input type="submit" value="{t}Upload{/t}" name="TmpFileUpload" {$FAItemplateFileACL}>
+{render acl=$FAItemplateFileACL}
+ <input type="file" name="FAItemplateFile" value="{$FAItemplateFile}" id="FAItemplateFile">
+{/render}
+{render acl=$FAItemplateFileACL}
+ <input type="submit" value="{t}Upload{/t}" name="TmpFileUpload">
+{/render}
<br>
<br>
</td>
</LABEL>
</td>
<td>
- <input type="text" name="FAItemplatePath" value="{$FAItemplatePath}" id="FAItemplatePath" size="45" {$FAItemplatePathACL}>
+{render acl=$FAItemplatePathACL}
+ <input type="text" name="FAItemplatePath" value="{$FAItemplatePath}" id="FAItemplatePath" size="45">
+{/render}
</td>
</tr>
</table>
</LABEL>
</td>
<td>
- <input type="text" name="user" value="{$user}" id="user" size="15" {$userACL}>
- </td>
+{render acl=$userACL}
+ <input type="text" name="user" value="{$user}" id="user" size="15">
+{/render}
+ </td>
</tr><tr>
<td style="vertical-align:top">
<LABEL for="group">
</LABEL>
</td>
<td>
- <input type="text" name="group" value="{$group}" id="group" size="15" {$groupACL}>
+{render acl=$groupACL}
+ <input type="text" name="group" value="{$group}" id="group" size="15">
+{/render}
<br>
<br>
- </td>
+ </td>
</tr><tr>
<td style="vertical-align:top">{t}Access{/t}{$must} </td>
<td>
<th> </th>
</tr>
<tr><td>{t}User{/t}</td>
- <td align="center"><input type="checkbox" name="u4" value="4" {$u4} {$userACL}></td>
- <td align="center"><input type="checkbox" name="u2" value="2" {$u2} {$userACL}></td>
- <td align="center"><input type="checkbox" name="u1" value="1" {$u1} {$userACL}></td>
+{render acl=$userACL}
+ <td align="center"><input type="checkbox" name="u4" value="4" {$u4}></td>
+{/render}
+{render acl=$userACL}
+ <td align="center"><input type="checkbox" name="u2" value="2" {$u2}></td>
+{/render}
+{render acl=$userACL}
+ <td align="center"><input type="checkbox" name="u1" value="1" {$u1}></td>
+{/render}
<td> </td>
- <td align="center"><input type="checkbox" name="s4" value="4" {$s4} {$userACL}></td>
+{render acl=$userACL}
+ <td align="center"><input type="checkbox" name="s4" value="4" {$s4}></td>
+{/render}
<td>({t}SUID{/t})</td>
</tr>
<tr><td>{t}Group{/t}</td>
- <td align="center"><input type="checkbox" name="g4" value="4" {$g4} {$userACL}></td>
- <td align="center"><input type="checkbox" name="g2" value="2" {$g2} {$userACL}></td>
- <td align="center"><input type="checkbox" name="g1" value="1" {$g1} {$userACL}></td>
+{render acl=$userACL}
+ <td align="center"><input type="checkbox" name="g4" value="4" {$g4}></td>
+{/render}
+{render acl=$userACL}
+ <td align="center"><input type="checkbox" name="g2" value="2" {$g2}></td>
+{/render}
+{render acl=$userACL}
+ <td align="center"><input type="checkbox" name="g1" value="1" {$g1}></td>
+{/render}
<td> </td>
- <td align="center"><input type="checkbox" name="s2" value="2" {$s2} {$userACL}></td>
+{render acl=$userACL}
+ <td align="center"><input type="checkbox" name="s2" value="2" {$s2}></td>
+{/render}
<td>({t}SGID{/t})</td>
</tr>
<tr><td>{t}Others{/t}</td>
- <td align="center"><input type="checkbox" name="o4" value="4" {$o4} {$userACL}></td>
- <td align="center"><input type="checkbox" name="o2" value="2" {$o2} {$userACL}></td>
- <td align="center"><input type="checkbox" name="o1" value="1" {$o1} {$userACL}></td>
+{render acl=$userACL}
+ <td align="center"><input type="checkbox" name="o4" value="4" {$o4}></td>
+{/render}
+{render acl=$userACL}
+ <td align="center"><input type="checkbox" name="o2" value="2" {$o2}></td>
+{/render}
+{render acl=$userACL}
+ <td align="center"><input type="checkbox" name="o1" value="1" {$o1}></td>
+{/render}
<td> </td>
- <td align="center"><input type="checkbox" name="s1" value="1" {$s1} {$userACL}></td>
+{render acl=$userACL}
+ <td align="center"><input type="checkbox" name="s1" value="1" {$s1}></td>
+{/render}
<td>({t}sticky{/t})</td>
</tr></table>