summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a638cd0)
raw | patch | inline | side by side (parent: a638cd0)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 14 Nov 2006 04:35:36 +0000 (04:35 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 14 Nov 2006 04:35:36 +0000 (04:35 +0000) |
Prepared several user addons for Copy & Paste
Fixed Setup problems, ne loop and missing error msgs anymore.
Added GraphiMagick fix
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5088 594d385d-05f5-0310-b6e9-bd551577e9d8
Fixed Setup problems, ne loop and missing error msgs anymore.
Added GraphiMagick fix
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5088 594d385d-05f5-0310-b6e9-bd551577e9d8
15 files changed:
diff --git a/html/setup.php b/html/setup.php
index aec16d04da27f6ba50e3d8a87fd1b024d4e73e7d..3320ffd20fb4117e9a71921bedaddcf136c94bd6 100644 (file)
--- a/html/setup.php
+++ b/html/setup.php
session_start();
$_SESSION['DEBUGLEVEL']= 1;
-
if (!isset($_GET['js']) && !isset($_SESSION['js'])){
echo '<script language="JavaScript" type="text/javascript">';
echo ' location = "setup.php?js=true";';
echo '</script>';
$_SESSION['js']= FALSE;
-} else {
+} elseif(isset($_GET['js'])) {
$_SESSION['js']= TRUE;
}
// No Errors occured yet
$_SESSION['errors']= "";
+$_SESSION['errors'] = "";
+$_SESSION['errorsAlreadyPosted']= array();
+$_SESSION['LastError'] = "";
+
// Print out gosa.conf
//if(isset($_SESSION['classes'])) print "\$_SESSION['classes']=ok";
// and we call this func again, to output the error
// I hope this will work fine ^^
-if((!show_setup_page1(false))||($next == 1)) {
+if((show_setup_page1(false))||($next == 1)) {
show_setup_page1();
-} elseif((!show_setup_page2(false))||($next==2)) {
+} elseif((show_setup_page2(false))||($next==2)) {
show_setup_page2();
-} elseif((!show_setup_page3(false))||($next==3)) {
+} elseif((show_setup_page3(false))||($next==3)) {
show_setup_page3();
-} elseif((!show_setup_page4(false))||($next==4)) {
+} elseif((show_setup_page4(false))||($next==4)) {
show_setup_page4();
}
// This is called to test if we have an administrative Group with a User in it
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
?>
-</body>
-</html>
index 09b0894087842b1282015d08788b7a6bc14e3d99..df4d2be7c969085127ed84a98693f5b086c3fd6a 100644 (file)
</tr>
<tr style='height:100%;'>
<td style="background-color: white;vertical-align:top;" colspan=2>
+
{include file="$content"}
+
</td>
</tr>
-<table summary="">
+</table>
<script language="JavaScript" type="text/javascript">
<!--
h=parseInt(window.innerHeight)-20;
- document.write('</div>');
+ document.write('<\/div>');
//-->
</script>
diff --git a/ihtml/themes/default/setup_introduction.tpl b/ihtml/themes/default/setup_introduction.tpl
index abdf49860c2f124ace51b5f2747bc68f706fea74..451855b523207da276b76e8eb7cc659a5ed05027 100644 (file)
</div>
<p class="plugbottom">
<input type="hidden" name="next" value="2">
- <input type='submit' name='continue' value='{t}Continue{/t}'>
+ <input type='submit' name='continue' value='{t}Continue{/t}' {$mode}>
</p>
<p class="seperator"> </p>
index 6d23e42efe2e85688544fbe3c855977f4ac7adbc..763b3f1f5278a384ebd3e0b0eebcc507ba163bd7 100644 (file)
<p class="plugbottom">
<input type="hidden" name="next" value="3">
<input type='submit' name='back' value='{t}Back{/t}'>
- <input type='submit' name='continue2' value='{t}Continue{/t}'>
+ <input type='submit' name='continue2' value='{t}Continue{/t}' {$mode}>
</p>
index 5336f57c7bde328bb71732b783851d99db38b0a7..78cfb746bd115f9cad1961e131ac60ffe6bc6fdd 100644 (file)
}
}else{
$this->current->save();
+ $this->lastdn = $this->current->dn;
$this->dialogOpen =false;
$this->Clear();
}
index 9f92c624b90d15f7ada4db1823710116c196d1c1..72793b3c75ef87e45c321b900f6129c13d6e94d5 100644 (file)
--- a/include/class_plugin.inc
+++ b/include/class_plugin.inc
}
$todo[] = "is_account";
foreach($todo as $var){
- $this->$var = $source->$var;
+ if (isset($source->$var)){
+ $this->$var= $source->$var;
+ }
}
}
index cabcbbdb1c9128883b402e4fe900c3d2757a03c0..7d5582b06223aa3e1516d731c283fc1582978496 100644 (file)
$result= "<a href='http://de.php.net/manual/en/function.";
/* Replace all underscores with hyphens (phpdoc convention) */
+ /* hjb: added alternative check for GraphicsMagick >= 1.1.2 */
$function_name= str_replace("_", "-", $function_name);
/* Append to base URL */
$output= shell_exec ($query);
if ($output != ""){
$lines= split ("\n", $output);
- $version= preg_replace ("/^Version:.+Magick ([^\s]+).*/", "\\1", $lines[0]);
- list($major, $minor)= split("\.", $version);
- $msg.= check ( $faults, _("Checking for ImageMagick (>=5.4.0)"),
- _("ImageMagick is used to convert user supplied images to fit the suggested size and the unified JPEG format."),
- ($major > 5 || ($major == 5 && $minor >= 4)));
+ $version= preg_replace ("/^Version: (.+Magick) ([^\s]+).*/", "\\1 \\2", $lines[0]);
+ list($prog, $version) = split(" ", $version);
+ list($major, $minor,$minor2)= split("\.", $version);
+ if (preg_match('/GraphicsMagick/', $prog)) {
+ $msg.= check ( $faults, _("Checking for GraphicsMagick (>=1.1.2)"),
+ _("GraphicsMagick is used to convert user supplied images to fit the suggested size and the unified JPEG format."),
+ ($major > 1 || ($major == 1 && $minor >= 1) || ($major == 1 && $minor == 1 && $minor2 >= 2) ) );
+ } else {
+ $msg.= check ( $faults, _("Checking for ImageMagick (>=5.4.0)"),
+ _("ImageMagick is used to convert user supplied images to fit the suggested size and the unified JPEG format."),
+ ($major > 5 || ($major == 5 && $minor >= 4)));
+ }
} else {
$msg.= check ( $faults, _("Checking imagick module for PHP"),
_("Imagick is used to convert user supplied images to fit the suggested size and the unified JPEG format from PHP script."), function_exists('imagick_blob2image'), TRUE);
/* Show setup_page 1 */
function show_setup_page1($withoutput = true)
{
- $faults = array();
+ $faults = false;
+ $faults2 = false;
$smarty = get_smarty();
$smarty->assign ("content", get_template_path('setup_introduction.tpl'));
$smarty->assign ("tests", perform_php_checks($faults));
- $smarty->assign ("detailed_tests", perform_additional_function_checks($faults));
+ $smarty->assign ("detailed_tests", perform_additional_function_checks($faults2));
+
+ $faults = $faults || $faults2;
/* This var is true if anything went wrong */
if ($faults){
$smarty->display (get_template_path('setup.tpl'));
}
- return (!$faults);
+ return ($faults);
}
/* Show setup_page 2 */
function show_setup_page2($withoutput = true)
{
- $faults = array();
+ $faults = false;
$smarty = get_smarty();
$smarty->assign ("content", get_template_path('setup_step2.tpl'));
$smarty->assign ("tests", perform_additional_checks($faults));
$smarty->display (get_template_path('setup.tpl'));
}
- return (!$faults);
+ return ($faults);
}
/* No error till now */
$fault = false;
- /* If we pushed the Button continue */
- if(isset($_POST['continue3'])){
- if(!isset($uri)) {
- $fault = true;
-
- /* Output the Error */
- if($withoutput) {
- print_red (_("You've to specify an ldap server before continuing!"));
- $smarty->assign ("content", get_template_path('setup_step3.tpl'));
- }
- }
- } elseif (!$ds = @ldap_connect (validate($uri))) {
+ if (!$ds = @ldap_connect (validate($uri))) {
$fault =true;
/* Output the Error */
$smarty->display (get_template_path('setup.tpl'));
}
- return (!$fault);
+ return ($fault);
}
{
$smarty= get_smarty();
+ /* check POST data */
+ if(isset($_POST['check'])) {
+
+ /* Check if all needed vars are submitted */
+ foreach($checkvars as $key) {
+ if($key == "peopleou"){
+ continue;
+ }
+ if($key == "groupou"){
+ continue;
+ }
+
+ if((isset($_POST[$key]))&&($_POST[$key]!="")) {
+ $_SESSION['ldapconf'][$key] = $_POST[$key];
+ } else {
+ if($withoutput) {
+ print_red(sprintf(_("You're missing the required attribute '%s' from this formular. Please complete!"), $key));
+ }
+ $fault = true;
+ }
+ }
+ }
+
+ /* Transfer base */
+ if(isset($_POST['base'])){
+ $_SESSION['ldapconf']['base']= $_POST['base'];
+ }
+
// ?
if(!isset($_SESSION['ldapconf']['base'])){
$_SESSION['ldapconf']['base']= $base;
/* If there are some empty vars in ldapconnect -
these values also represent out default values */
- if(!$ds = @ldap_connect (validate($uri))){
+ if(!$ds = @ldap_connect (validate($uri))){
$fault = true;
if($withoutput){
print_red (_("Can't connect to the specified LDAP server! Please make sure that is reachable for GOsa."));
} elseif(!@ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3)){
$fault = true;
if($withoutput){
- print_red (_("Can't bind to the specified LDAP server! Please make sure that it is reachable for GOsa."));
+ print_red (_("Can't set ldap protocol version 3."));
}
} elseif(!$r= @ldap_bind ($ds)){
$fault = true;
if($withoutput){
- print_red (_("Can't bind to the specified LDAP server! Please make sure that it is reachable for GOsa."));
+ print_red (_("Could not bind to the specified LDAP server! Please make sure that it is reachable for GOsa."));
}
} else {
- $sr= @ldap_search ($ds, NULL, "objectClass=*", array("namingContexts"));
+ $sr= @ldap_search ($r, NULL, "objectClass=*", array("namingContexts"));
$attr= @ldap_get_entries($ds,$sr);
if((empty($attr))) {
- $base= "dc=example,dc=net";
if($withoutput){
- print_red(_("Bind to server successful, but the server seems to be completly empty, please check all information twice"));
+# print_red(_("Bind to server successful, but the server seems to be completly empty, please check all information twice"));
}
} else {
$_SESSION['ldapconf']['arr_crypts'] = $tmp['md5'];
}
- /* check POST data */
- if(isset($_POST['check'])) {
-
- /* Check if all needed vars are submitted */
- foreach($checkvars as $key) {
- if($key == "peopleou"){
- continue;
- }
- if($key == "groupou"){
- continue;
- }
-
- if((isset($_POST[$key]))&&($_POST[$key]!="")) {
- $_SESSION['ldapconf'][$key] = $_POST[$key];
- } else {
- if($withoutput) {
- print_red(sprintf(_("You're missing the required attribute '%s' from this formular. Please complete!"), $key));
- }
- $fault = true;
- }
- }
- }
-
- /* Transfer base */
- if(isset($_POST['base'])){
- $_SESSION['ldapconf']['base']= $_POST['base'];
- }
-
$smarty->assign("arr_cryptkeys",$_SESSION['ldapconf']['arr_cryptkeys']);
$smarty->assign("mail_methods", $_SESSION['ldapconf']['mail_methods']);
$smarty->assign($key,$val);
}
- if(isset($_POST['check'])) {
+ if(isset($_POST['check']) || (isset($_POST['admin'])) && isset($_POST['password'])) {
$ldap= new LDAP($_SESSION['ldapconf']['admin'],
$_SESSION['ldapconf']['password'],
$_SESSION['ldapconf']['uri']);
if($withoutput){
$smarty->display (get_template_path('setup.tpl'));
}
- return (!$fault);
+
+ return ($fault);
}
diff --git a/plugins/admin/users/class_userManagement.inc b/plugins/admin/users/class_userManagement.inc
index daa147d92741f7c44fdfe6d3a5892a645123d653..cd3d5a39246042ecb4fe756431cf6c0270382294 100644 (file)
/* Creat dialog object */
$this->DivListUsers = new divListUsers($this->config,$this);
- /* LOCK MESSAGE Vars */
- $_SESSION['LOCK_VARS_TO_USE'] = array("/^act$/","/^id$/","/^user_edit_/","/^user_del_/");
}
/* Call parent execute */
plugin::execute();
+ /* LOCK MESSAGE Vars */
+ $_SESSION['LOCK_VARS_TO_USE'] = array("/^act$/","/^id$/","/^user_edit_/","/^user_del_/");
+
$smarty = get_smarty(); // Smarty instance
$s_action = ""; // Contains the action to be taken
$s_entry = ""; // The value for s_action
if (isset($_POST['password_finish'])){
/* For security reasons, check if user is allowed to set password again */
- $dn = $this->usertab->dn;
+ $dn = $this->dn;
$acl = $this->ui->get_permissions($dn, "users/password");
$cacl= $this->ui->get_permissions($dn, "users/user");
/* Use the last dn to search for it's ID in the newly generated list. */
$dn= $this->CopyPasteHandler->lastdn;
+
+ /* Get new user list */
+ $this->reload();
foreach($this->list as $id => $entry){
if($entry['dn'] == $dn){
$s_entry= $id;
index 53b986073c2f732e93431ab48dcd7a298a4f7d34..a407f793625956b1bbdda4078860c89dff65debf 100644 (file)
/* Read out data*/
$timeto = $certificate->getvalidto_date();
$timefrom = $certificate->getvalidfrom_date();
- $str = "<table summary=\"\" border=0><tr><td style='vertical-align:top'>CN</td><td>".preg_replace("/ /", " ", $certificate->getname())."</td></tr></table><br>".
- sprintf(_("Certificate is valid from %s to %s and is currently %s."), "<b>".date('d M Y',$timefrom)."</b>","<b>".date('d M Y',$timeto)."</b>", $certificate->isvalid()?"<b><font style='color:green'>"._("valid")."</font></b>":"<b><font style='color:red'>"._("invalid")."</font></b>");
+
+
+ /* Additional info if start end time is '0' */
+ $add_str_info = "";
+ if($timeto == 0 && $timefrom == 0){
+ $add_str_info = "<br><i>"._("(Some types of certificates are currently not supported and may be displayed as 'invalid'.)")."</i>";
+ }
+
+ $str = "<table summary=\"\" border=0>
+ <tr>
+ <td style='vertical-align:top'>CN</td>
+ <td>".preg_replace("/ /", " ", $certificate->getname())."</td>
+ </tr>
+ </table><br>".
+
+ sprintf(_("Certificate is valid from %s to %s and is currently %s."),
+ "<b>".date('d M Y',$timefrom)."</b>",
+ "<b>".date('d M Y',$timeto)."</b>",
+ $certificate->isvalid()?"<b><font style='color:green'>"._("valid")."</font></b>":
+ "<b><font style='color:red'>"._("invalid")."</font></b>").$add_str_info;
+
$smarty->assign($cert."info",$str);
$smarty->assign($cert."_state","true");
} else {
}
+ function PrepareForCopyPaste($source)
+ {
+ plugin::PrepareForCopyPaste($source);
+
+ /* Reset certificate information addepted from source user
+ to avoid setting the same user certificate for the destination user. */
+ $this->userPKCS12= "";
+ $this->userSMIMECertificate= "";
+ $this->userCertificate= "";
+ $this->certificateSerialNumber= "";
+ $this->old_certificateSerialNumber= "";
+ $this->old_userPKCS12= "";
+ $this->old_userSMIMECertificate= "";
+ $this->old_userCertificate= "";
+ }
+
+
function plInfo()
{
diff --git a/plugins/personal/mail/class_mailAccount.inc b/plugins/personal/mail/class_mailAccount.inc
index 3ec98eea56712c508990a30b94c541e4b7b118eb..327f9069006c59e5ce1747e3f3aa8d673206a5f3 100644 (file)
}
}
+
+ function PrepareForCopyPaste($source)
+ {
+ plugin::PrepareForCopyPaste($source);
+
+ /* Reset alternate mail addresses */
+ $this->gosaMailAlternateAddress = array();
+ }
+
function plInfo()
{
index 3af89089dc533a470a0fc034fb5539fb4d2540c4..d277ceb458c8ce830eb7079343ecd20c4d79a8af 100644 (file)
<table summary="" style="width:100%; vertical-align:top; text-align:left;" cellpadding=4>
-<tr>
- <td style="vertical-align:top;width:600px">
- <div class="contentboxh" style="height:20px;">
- <p class="contentboxh" style="font-size:12px">
- <b><LABEL for="local_list">{t}Select addresses to add{/t}</LABEL> {$hint}</b><br>
- </p>
- </div>
- <div class="contentboxb">
- <p class="contentboxb" style="border-top:1px solid #B0B0B0;background-color:#F8F8F8">
- <select id="local_list" style="width:600px; margin-top:4px; height:450px;" name="local_list[]" size="15" multiple>
- {html_options options=$mailusers}
- </select>
- </p>
- </div>
- </td>
- <td style="vertical-align:top;">
- <div class="contentboxh" style="height:20px;">
- <p class="contentboxh" style="font-size:12px"><img src="{$launchimage}" align="right" alt="[F]"><b>
- {t}Filters{/t}</b></p>
- </div>
- <div class="contentboxb" style="background-color:#F8F8F8">
- <table summary="" style="width:100%;border-top:1px solid #B0B0B0; background-color:#F8F8F8">
- {$alphabet}
- </table>
- <table summary="" width="100%" style="border-top:1px solid #B0B0B0;background-color:#F8F8F8"><tr><td><LABEL for="depselect"><img alt="" src="{$tree_image}" align=middle>
- <select id="depselect" name="depselect" size=1 onChange="mainform.submit()" title="{t}Choose the department the search will be based on{/t}">
- {html_options options=$deplist selected=$depselect}
- </select></td></tr></table>
- <table summary="" width="100%" style="border-top:1px solid #B0B0B0;background-color:#F8F8F8"><tr><td style="width:18px"><img alt="" src="{$search_image}" align=middle></td><td>
- <input type='text' name='regex' maxlength='20' style="width:99%" value='{$regex}' title='{t}Regular expression for matching addresses{/t}' onChange="mainform.submit()"></td></tr></table>
- <table summary="" width="100%" style="border-top:1px solid #B0B0B0;background-color:#F8F8F8"><tr><td width="18px"><img src="{$usearch_image}" align=middle alt={t}Display addresses of user{/t}""></td>
- <td><input type='text' name='muser' maxlength='20' style="width:99%" value='{$muser}' title='{t}User name of which addresses are shown{/t}' onChange="mainform.submit()"></td></tr></table>
- {$apply}
- </div>
- </td>
-</tr>
+ <tr>
+ <td style="vertical-align:top;width:600px">
+ <div class="contentboxh" style="height:20px;">
+ <p class="contentboxh" style="font-size:12px">
+ <b>
+ <LABEL for="local_list">{t}Select addresses to add{/t}</LABEL>
+ {$hint}
+ </b>
+ <br>
+ </p>
+ </div>
+ <div class="contentboxb">
+ <p class="contentboxb" style="border-top:1px solid #B0B0B0;background-color:#F8F8F8">
+ <select id="local_list" style="width:600px; margin-top:4px; height:450px;" name="local_list[]" size="15" multiple>
+ {html_options options=$mailusers}
+ </select>
+ </p>
+ </div>
+ </td>
+ <td style="vertical-align:top;">
+ <div class="contentboxh" style="height:20px;">
+ <p class="contentboxh" style="font-size:12px">
+ <img src="{$launchimage}" align="right" alt="[F]">
+ <b>{t}Filters{/t}</b>
+ </p>
+ </div>
+ <div class="contentboxb" style="background-color:#F8F8F8">
+ <table summary="" style="width:100%;border-top:1px solid #B0B0B0; background-color:#F8F8F8">
+ {$alphabet}
+ </table>
+ <table summary="" width="100%" style="border-top:1px solid #B0B0B0;background-color:#F8F8F8">
+ <tr>
+ <td>
+ <LABEL for="depselect">{t}Select department{/t}</LABEL>
+ <img alt="" src="{$tree_image}" align=middle>
+ <select id="depselect" name="depselect" size=1 onChange="mainform.submit()"
+ title="{t}Choose the department the search will be based on{/t}">
+ {html_options options=$deplist selected=$depselect}
+ </select>
+ </td>
+ </tr>
+ </table>
+
+ <table summary="" width="100%" style="border-top:1px solid #B0B0B0;background-color:#F8F8F8">
+ <tr>
+ <td style="width:18px">
+ <img alt="" src="{$search_image}" align="middle">
+ </td>
+ <td>
+ <input type='text' name='regex' maxlength='20' style="width:99%" value='{$regex}'
+ title='{t}Regular expression for matching addresses{/t}' onChange="mainform.submit()">
+ </td>
+ </tr>
+ </table>
+
+ <table summary="" width="100%" style="border-top:1px solid #B0B0B0;background-color:#F8F8F8">
+ <tr>
+ <td style="width:18px;">
+ <img src="{$usearch_image}" align=middle alt="{t}Display addresses of user{/t}">
+ </td>
+ <td>
+ <input type='text' name='muser' maxlength='20' style="width:99%" value='{$muser}'
+ title='{t}User name of which addresses are shown{/t}' onChange="mainform.submit()">
+ </td>
+ </tr>
+ </table>
+ {$apply}
+ </div>
+ </td>
+ </tr>
</table>
<p class="plugbottom">
<input type=submit name="add_locals_cancel" value="{t}Cancel{/t}">
</p>
+<!--
+// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
+-->
diff --git a/plugins/personal/netatalk/class_netatalk.inc b/plugins/personal/netatalk/class_netatalk.inc
index 9478ccb42029f33c617a03e01df2e884dc633195..f17f5b36b1b9e3df943c7bd3a51e1379ce1bf50d 100644 (file)
var $shares_loaded= false;
/* Attributes to save to LDAP */
+ var $attributes = array ("apple-user-homeurl", "apple-user-homeDirectory");
+ var $CopyPasteVars= array("apple_user_homeurl", "apple_user_homeDirectory","apple_user_share","shares_settings","apple_user_homepath_raw",
+ "apple_user_homeurl_raw","apple_user_homeurl_xml","apple_user_homeurl","selectedshare","mountDirectory");
+
/* Slip setting those attributes, we can't define class variables with - */
var $use_save_attributes = array ("apple-user-homeurl", "apple-user-homeDirectory");
var $is_chk_box = array ();
var $uid = "";
+
+ /* The constructor just saves a copy of the config. You may add what ever you need. */
+ function netatalk($config, $dn = NULL,$parent = NULL) {
+
+ /* Include config object */
+ $this->config = $config;
+ plugin :: plugin($config, $dn,$parent);
+
+ /* Setting uid to default */
+ if(isset($this->attrs['uid'][0])){
+ $this->uid = $this->attrs['uid'][0];
+ }
+
+ /* Copy needed attributes */
+ foreach($this->attributes as $val) {
+ if (isset($this->attrs["$val"][0])) {
+ $name = str_replace('-', '_', $val);
+ $this->$name = $this->attrs["$val"][0];
+ }
+ }
+
+ if (strlen($this->apple_user_homeDirectory) >0) {
+ $this->apple_user_homepath_raw = substr($this->apple_user_homeDirectory, strrpos($this->apple_user_homeDirectory, '/') + 1 );
+ }
+
+ /* get share list an set default values */
+ $this->get_netatalk_shares();
+ $this->apple_user_share = $this->selectedshare;
+
+ /* Save initial account state */
+ $this->initially_was_account = $this->is_account;
+ }
+
+
function get_shares()
{
$this->shares_loaded= TRUE;
asort($this->shares);
}
- /* The constructor just saves a copy of the config. You may add what ever you need. */
- function netatalk($config, $dn = NULL) {
- /* Include config object */
- $this->config = $config;
- plugin :: plugin($config, $dn);
-
- /* Setting uid to default */
- if(isset($this->attrs['uid'][0])){
- $this->uid = $this->attrs['uid'][0];
- }
-
- /* Copy needed attributes */
- foreach($this->use_save_attributes as $val) {
- if (isset($this->attrs["$val"][0])) {
- $name = str_replace('-', '_', $val);
- $this->$name = $this->attrs["$val"][0];
- }
- }
-
- if (strlen($this->apple_user_homeDirectory) >0) {
- $this->apple_user_homepath_raw = substr($this->apple_user_homeDirectory, strrpos($this->apple_user_homeDirectory, '/') + 1 );
- }
-
- /* Save initial account state */
- $this->initially_was_account = $this->is_account;
- }
/* Execute the plugin, produce the output. */
function execute() {
/* Check if we have correct data */
function check() {
$message = array ();
-
+
if (strlen($this->apple_user_share) == 0) {
$message[] = _("You must select a share to use.");
}
$ldap = $this->config->get_ldap_link();
- /* Call parents save to prepare $this->attrs */
+ /* Reset array of used attributes, because plugin::save()
+ will not work with '-' in attributes names
+ after calling save restore attributes array */
+ $attributes = $this->attributes;
+ $this->attributes = array();
plugin :: save();
+ $this->attributes = $attributes;
/* Do attribute conversion */
foreach ($this->use_save_attributes as $val) {
diff --git a/plugins/personal/posix/class_posixAccount.inc b/plugins/personal/posix/class_posixAccount.inc
index 552f59a36958e94ad2e8574f72cbd94deb6dc9fb..bbbcee0f3b5a9d0ffd460a6ae59813f38f19888b 100644 (file)
var $SubSearch = false;
/* attribute list for save action */
- var $CopyPasteVars = array("grouplist","groupMembership","use_shadowMin","use_shadowMax",
- "use_shadowWarning","use_shadowInactive","use_shadowExpire","mustchangepassword",
- "force_ids","printerList","grouplist","savedGidNumber","savedUidNumber","savedGroupMembership");
+ var $CopyPasteVars =
+ array("grouplist","groupMembership","use_shadowMin",
+ "use_shadowMax","use_shadowWarning","use_shadowInactive","use_shadowExpire",
+ "must_change_password","printerList","grouplist","savedGidNumber","savedUidNumber");
var $attributes = array("homeDirectory", "loginShell", "uidNumber", "gidNumber", "gecos",
"shadowMin", "shadowMax", "shadowWarning", "shadowInactive", "shadowLastChange",
}
/* Fill calendar */
- $date= getdate($this->shadowExpire);
-
+ /* If this $this->shadowExpire is empty
+ use current date as base for calculating selectbox values.
+ (This attribute is empty if this is a new user )*/
+ if(empty($this->shadowExpire)){
+ $date= getdate(time());
+ }else{
+ $date= getdate($this->shadowExpire);
+ }
+
$days= array();
for($d= 1; $d<32; $d++){
$days[$d]= $d;
/* Remove lock needed for unique id generation */
del_lock ("uidnumber");
-
- /* Posix accounts have group interrelationship, take care about these here. */
- if ($this->force_ids == 0 && $this->primaryGroup == 0){
+ /* Posix accounts have group interrelationship,
+ take care about these here if this is a new user without forced gidNumber. */
+ if ($this->force_ids == 0 && $this->primaryGroup == 0 && !$this->initially_was_account){
$ldap->cd($this->config->current['BASE']);
$ldap->search("(&(objectClass=posixGroup)(gidNumber=".$this->gidNumber."))", array("cn"));
}
+ /* Get posts from copy & paste dialog */
+ function saveCopyDialog()
+ {
+ if(isset($_POST['homeDirectory'])){
+ $this->homeDirectory = $_POST['homeDirectory'];
+ if (isset ($_POST['force_ids'])){
+ $data= 1;
+ $this->gidNumber = $_POST['gidNumber'];
+ $this->uidNumber = $_POST['uidNumber'];
+ } else {
+ $data= 0;
+ }
+ if ($this->force_ids != $data){
+ $this->is_modified= TRUE;
+ }
+ $this->force_ids= $data;
+ }
+ }
+
+
/* Create the posix dialog part for copy & paste */
function getCopyDialog()
{
}
+ function PrepareForCopyPaste($source)
+ {
+ plugin::PrepareForCopyPaste($source);
+
+ /* Avoid using the same gid/uid number as source user */
+ $this->savedUidNumber = $this->get_next_id("gidNumber");
+ $this->savedGidNumber = $this->get_next_id("uidNumber");
+ }
+
+
function plInfo()
{
return (array(
index fbb298152578cc707c0b5319754f7efa2673de33..baf71141a45e8a1fc41cc28446e2c537bc196257 100644 (file)
</td>
</tr>
</table>
- <table>
+ <table style='width:100%;'>
<tr>
<td>
<input id="force_ids" type=checkbox name="force_ids" value="1" {$force_ids}
diff --git a/plugins/personal/samba/class_sambaAccount.inc b/plugins/personal/samba/class_sambaAccount.inc
index 017e4d7588f7ccf4d0ddc6968ac10b1e082ef578..98357370a1e5b8a5294e8fc579357e35b0c79e5b 100644 (file)
$smarty->assign("flagsN", "");
}
- /* 'normal' Checkboxes */
- if ($this->pwdCanChange=="1"){
- $smarty->assign("flagsP", "checked");
- } else {
- $smarty->assign("flagsP", "");
+ if($this->samba3){
+ if ($this->sambaPwdCanChange=="1"){
+ $smarty->assign("flagsP", "checked");
+ } else {
+ $smarty->assign("flagsP", "");
+ }
+ }else{
+ if ($this->pwdCanChange=="1"){
+ $smarty->assign("flagsP", "checked");
+ } else {
+ $smarty->assign("flagsP", "");
+ }
}
+
if ($this->password_expires=="1"){
$smarty->assign("flagsC", "checked");
} else {