summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a5a1864)
raw | patch | inline | side by side (parent: a5a1864)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 22 Nov 2005 12:45:55 +0000 (12:45 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 22 Nov 2005 12:45:55 +0000 (12:45 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2007 594d385d-05f5-0310-b6e9-bd551577e9d8
include/class_debconfTemplate.inc | patch | blob | history | |
plugins/admin/fai/class_faiPackage.inc | patch | blob | history |
index 6e96574c645e3da7c1302d6f2e92d558235fd1db..7438df7ca349b0e2c79fc068bb8012a2a15f2a3f 100644 (file)
$this->template= array();
/* Read template array */
- $post_name= 0;
- $langcode= $this->language.".UTF-8";
- $in_description= FALSE;
+ $post_name = 0;
+ $langcode = $this->language.".UTF-8";
+ $in_description = FALSE;
$got_local_description= FALSE;
+
$fh= fopen($filename, 'r');
while (!feof($fh)){
/* Template header */
if (preg_match("/^Template: /", $line)){
$post_name ++;
-
$name= trim(preg_replace("/^Template: (.*)$/", "\\1", $line));
-
$this->template[$post_name]['Name'] = $name;
$this->template[$post_name]['Default'] ="";
}
+ /* Check if some fields are posted */
function PostCheck()
{
+ /* Walk through all template variables */
foreach($this->template as $post_name => $entry){
+
+ /* Check if this var is set*/
if(isset($_POST[$entry['post_name']])){
+
+ /* special handling for arrays */
if(is_array($_POST[$entry['post_name']])){
$str = "";
foreach($_POST[$entry['post_name']] as $val){
}
+
+ /* This funtion sets the defualt value */
function SetDefault($var,$val)
{
if($this->has_template){
}
}
+
+ /* Display all possible options in html*/
function get_dialog()
{
if ($this->has_template){
return ("");
}
-
- function get_template_packages()
- {
- }
-
-
- function set_default($default)
- {
- }
-
-
}
# Example:
index 2c78f60acf8d578f09afe32a01ef30fa0b70c025..a0be45fcb94ca72a14e3e44a48577ef82a2d910b 100644 (file)
$this->attrs['FAIdebianSection'][] = $sec;
}
- /* Save Package configurations */
+ $ldap->cat($this->dn);
+ if($ldap->count()!=0){
+ /* Write FAIscript to ldap*/
+ $ldap->cd($this->dn);
+ $ldap->modify($this->attrs);
+ }else{
+ /* Write FAIscript to ldap*/
+ $ldap->cd($this->config->current['BASE']);
+ $ldap->create_missing_trees(preg_replace('/^[^,]+,/', '', $this->dn));
+ $ldap->cd($this->dn);
+ $ldap->add($this->attrs);
+ }
+ show_ldap_error($ldap->get_error());
+
+ /* Save Package configurations */
foreach($this->ConfiguredPackages as $pkgname => $attrs){
foreach($attrs as $name => $attr){
foreach($attr as $n=>$v){
if(empty($v)) $v = array();
}
-
+
/* Set attributes */
$pkgattrs['objectClass'] = "FAIdebconfInfo";
$pkgattrs['FAIpackage'] = $pkgname;
$pkgattrs['FAIvariableType'] = $attr['Type'];
$pkgattrs['FAIvariableContent'] = $attr['Value'];
$pkgdn = "FAIvariable=".$name.",".$this->dn;
-
- /* cehck if object already exists */
+
+ /* cehck if object already exists */
$ldap->cat($pkgdn);
if($ldap->count()!=0){
$ldap->cd($pkgdn);
$ldap->add($pkgattrs);
}
show_ldap_error($ldap->get_error());
- }
+ }
}
- $ldap->cat($this->dn);
- if($ldap->count()!=0){
- /* Write FAIscript to ldap*/
- $ldap->cd($this->dn);
- $ldap->modify($this->attrs);
- }else{
- /* Write FAIscript to ldap*/
- $ldap->cd($this->config->current['BASE']);
- $ldap->create_missing_trees(preg_replace('/^[^,]+,/', '', $this->dn));
- $ldap->cd($this->dn);
- $ldap->add($this->attrs);
- }
- show_ldap_error($ldap->get_error());
+
+
+
}
}