summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1898a27)
raw | patch | inline | side by side (parent: 1898a27)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 5 Oct 2005 07:55:38 +0000 (07:55 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 5 Oct 2005 07:55:38 +0000 (07:55 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1474 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 b33788bd56a559db4cf8a22710b97fa706e30bb7..0d1ea42a6652df1d9a77581eaf6810277d112c21 100644 (file)
foreach($this->sub64coded as $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]]['status'] = "edited";
$this->SubObjects[$object['cn'][0]]['dn'] = $object['dn'];
}
show_ldap_error($ldap->get_error());
}
}
+
+ function readBinary($attr,$dn){
+ $Data ="";
+ $ds= ldap_connect($this->config->current['SERVER']);
+ ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
+ if (function_exists("ldap_set_rebind_proc") && isset($this->config->current['RECURSIVE']) && $this->config->current['RECURSIVE'] == "true") {
+ ldap_set_option($this->cid, LDAP_OPT_REFERRALS, 1);
+ ldap_set_rebind_proc($ds, array(&$this, "rebind"));
+ }
+
+ if(isset($this->config->current['TLS']) && $this->config->current['TLS'] == "true"){
+ ldap_start_tls($ds);
+ }
+
+ $r = ldap_bind($ds);
+ $sr = @ldap_read($ds, $dn, $attr."=*", array($attr));
+
+ if ($sr) {
+ $ei=ldap_first_entry($ds, $sr);
+ if ($ei) {
+ if ($info = ldap_get_values_len($ds, $ei, $attr)){
+ $Data= $info[0];
+ }
+ }
+ }
+
+ /* close conncetion */
+ ldap_unbind($ds);
+ return($Data);
+ }
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
diff --git a/plugins/admin/fai/class_faiTemplateEntry.inc b/plugins/admin/fai/class_faiTemplateEntry.inc
index 4476c548505e5bede0641538d35952fff0dae1f3..c4e8dad3a3139ef49779d48df93405f1eaeca66d 100644 (file)
$smarty = get_smarty();
$display = "";
+ if(isset($_POST['TmpFileUpload'])){
+ if($str=file_get_contents($_FILES['FAItemplateFile']['tmp_name'])){
+ $this->Object_FAItemplateFile = $str;
+ }
+
+ }
foreach($this->attributes as $attrs){
$smarty->assign($attrs,stripslashes($this->$attrs));
}
+ $smarty->assign("Object_FAItemplateFile","");
+
for($i =1 ; $i <= 100 ; $i++){
$Object_FAIprioritys[$i]=$i;
}
{
if(isset($_POST['SubObjectFormSubmitted'])){
foreach($this->attributes as $attrs){
+ if($attrs == "Object_FAItemplateFile") continue;
if(isset($_POST[$attrs])){
$this->$attrs = $_POST[$attrs];
}else{
index e7ef3a72144e9e4c8efe4175ca90f5ad3e92d8e2..57d1d9e7317721d2901af0ef2231ab9242a0c193 100644 (file)
</LABEL>
</td>
<td>
- <input type="text" name="Object_FAItemplateFile" value="{$Object_FAItemplateFile}" id="Object_FAItemplateFile">
+ <input type="file" name="FAItemplateFile" value="{$Object_FAItemplateFile}" id="Object_FAItemplateFile">
+ <input type="submit" value="{t}upload{/t}" name="TmpFileUpload">
</td>
</tr>
<tr>