Help-Entries for account.php are now complete but helptext is

missing very often.
    Fixed smaller problem when no Additional groups were active
This commit is contained in:
katagia 2003-06-08 10:33:37 +00:00
parent c4b6437954
commit 84114716db
3 changed files with 81 additions and 151 deletions

View File

@ -272,90 +272,12 @@ $helpArray = array (
"Text" => _("eMail Address")),
"457" => array ("ext" => "FALSE", "Headline" => _("Save Profile"),
"Text" => _("Save Profile")),
"458" => array ("ext" => "FALSE", "Headline" => _(""),
"Text" => _("")),
"459" => array ("ext" => "FALSE", "Headline" => _(""),
"Text" => _("")),
"460" => array ("ext" => "FALSE", "Headline" => _(""),
"Text" => _("")),
"461" => array ("ext" => "FALSE", "Headline" => _(""),
"Text" => _("")),
"462" => array ("ext" => "FALSE", "Headline" => _(""),
"Text" => _("")),
"463" => array ("ext" => "FALSE", "Headline" => _(""),
"Text" => _("")),
"464" => array ("ext" => "FALSE", "Headline" => _(""),
"Text" => _("")),
"465" => array ("ext" => "FALSE", "Headline" => _(""),
"Text" => _("")),
"466" => array ("ext" => "FALSE", "Headline" => _(""),
"Text" => _("")),
"467" => array ("ext" => "FALSE", "Headline" => _(""),
"Text" => _("")),
"468" => array ("ext" => "FALSE", "Headline" => _(""),
"Text" => _("")),
"469" => array ("ext" => "FALSE", "Headline" => _(""),
"Text" => _("")),
"470" => array ("ext" => "FALSE", "Headline" => _(""),
"Text" => _("")),
"471" => array ("ext" => "FALSE", "Headline" => _(""),
"Text" => _("")),
"472" => array ("ext" => "FALSE", "Headline" => _(""),
"Text" => _("")),
"473" => array ("ext" => "FALSE", "Headline" => _(""),
"Text" => _("")),
"474" => array ("ext" => "FALSE", "Headline" => _(""),
"Text" => _("")),
"475" => array ("ext" => "FALSE", "Headline" => _(""),
"Text" => _("")),
"476" => array ("ext" => "FALSE", "Headline" => _(""),
"Text" => _("")),
"477" => array ("ext" => "FALSE", "Headline" => _(""),
"Text" => _("")),
"478" => array ("ext" => "FALSE", "Headline" => _(""),
"Text" => _("")),
"479" => array ("ext" => "FALSE", "Headline" => _(""),
"Text" => _("")),
"480" => array ("ext" => "FALSE", "Headline" => _(""),
"Text" => _("")),
"481" => array ("ext" => "FALSE", "Headline" => _(""),
"Text" => _("")),
"482" => array ("ext" => "FALSE", "Headline" => _(""),
"Text" => _("")),
"483" => array ("ext" => "FALSE", "Headline" => _(""),
"Text" => _("")),
"484" => array ("ext" => "FALSE", "Headline" => _(""),
"Text" => _("")),
"485" => array ("ext" => "FALSE", "Headline" => _(""),
"Text" => _("")),
"486" => array ("ext" => "FALSE", "Headline" => _(""),
"Text" => _("")),
"487" => array ("ext" => "FALSE", "Headline" => _(""),
"Text" => _("")),
"488" => array ("ext" => "FALSE", "Headline" => _(""),
"Text" => _("")),
"489" => array ("ext" => "FALSE", "Headline" => _(""),
"Text" => _("")),
"490" => array ("ext" => "FALSE", "Headline" => _(""),
"Text" => _("")),
"491" => array ("ext" => "FALSE", "Headline" => _(""),
"Text" => _("")),
"492" => array ("ext" => "FALSE", "Headline" => _(""),
"Text" => _("")),
"493" => array ("ext" => "FALSE", "Headline" => _(""),
"Text" => _("")),
"494" => array ("ext" => "FALSE", "Headline" => _(""),
"Text" => _("")),
"495" => array ("ext" => "FALSE", "Headline" => _(""),
"Text" => _("")),
"496" => array ("ext" => "FALSE", "Headline" => _(""),
"Text" => _("")),
"497" => array ("ext" => "FALSE", "Headline" => _(""),
"Text" => _("")),
"498" => array ("ext" => "FALSE", "Headline" => _(""),
"Text" => _("")),
"499" => array ("ext" => "FALSE", "Headline" => _(""),
"Text" => _(""))
"458" => array ("ext" => "FALSE", "Headline" => _("Host can change Password"),
"Text" => _("Host can change Password")),
"459" => array ("ext" => "FALSE", "Headline" => _("Host must change Password"),
"Text" => _("Host must change Password")),
"460" => array ("ext" => "FALSE", "Headline" => _("Windows Domain"),
"Text" => _("Windows Domain of host. Can be left empty."))
/* This is a sample help entry. Just copy this line an modify the vakues between the [] brackets.
Help text is located in the array:
"[Helpnumber]" => array ("ext" => "FALSE", "Headline" => _("[Headline]"), "Text" => _("[Text]"), "SeeAlso" => "[SeeAlso link]"),

View File

@ -1031,7 +1031,7 @@ function modifyhost($values,$values_old) { // Will modify the LDAP-Account
// Value stored in shadowExpire, days since 1.1.1970
$date = mktime(10,0,0, $values->unix_pwdexpire_mon, $values->unix_pwdexpire_day, $values->unix_pwdexpire_yea) / 86400 ;
settype($date, 'integer');
$values->general_dn = 'uid=' . $values->general_username . ',' . $_SESSION['config']->get_UserSuffix();
$values->general_dn = 'uid=' . $values->general_username . ',' . $_SESSION['config']->get_HostSuffix();
if ($values->general_username != $values_old->general_username) {
$attr['cn'] = $values->general_username; // posixAccount_req shadowAccount_req sambaAccount_may
$attr['uid'] = $values->general_username; // posixAccount_req
@ -1094,7 +1094,7 @@ function modifyhost($values,$values_old) { // Will modify the LDAP-Account
if ($values->smb_pwdcanchange==0 && $values_old->smb_pwdcanchange==1) $attr_rem['pwdCanChange'] = "1"; else $attr['pwdCanChange'] = "0"; // sambaAccount_may
if ($values->smb_pwdmustchange && $values->smb_pwdmustchange==0) $attr['pwdMustChange'] = "1"; else $attr['pwdMustChange'] = "0"; // sambaAccount_may
if ($values->smb_pwdmustchange==0 && $values->smb_pwdmustchange==1) $attr_rem['pwdMustChange'] = "1"; else $attr['pwdMustChange'] = "0"; // sambaAccount_may
$attr['acctFlags'] = smbflag(); // sambaAccount_may
$attr['acctFlags'] = smbflag($values); // sambaAccount_may
if (($values->smb_domain!='') && ($values->smb_domain!=$values_old->smb_domain)) $attr['domain'] = $values->smb_domain; // sambaAccount_may
if (($values->smb_domain=='') && ($values->smb_domain!=$values_old->smb_domain)) $attr_rem['domain'] = $values_old->smb_domain; // sambaAccount_may
@ -1102,18 +1102,18 @@ function modifyhost($values,$values_old) { // Will modify the LDAP-Account
$success = ldap_mod_del($_SESSION['ldap']->server(),$values->general_dn, $attr_rem);
if (!$success) return 5;
}
if ($values->general_username == $values_old->general_username) // Username hasn't changed
if ($values->general_username == $values_old->general_username) // Hostname hasn't changed
$success = ldap_modify($_SESSION['ldap']->server(),$values->general_dn, $attr);
else {
$result = ldap_search($_SESSION['ldap']->server(), $dn, "objectclass=PosixAccount");
$entry = ldap_first_entry($_SESSION['ldap']->server(), $result);
$attr_old = ldap_get_attributes($_SESSION['ldap']->server(), $entry);
$success = ldap_add($_SESSION['ldap']->server(),$values->general_dn, $attr_old);
if ($success) $success = ldap_delete($_SESSION['ldap']->server(),$values_old->general_dn);
if ($success) $success = ldap_mod_replace($_SESSION['ldap']->server(),$values->general_dn, $attr);
}
else {
$result = ldap_search($_SESSION['ldap']->server(), $dn, "objectclass=PosixAccount");
$entry = ldap_first_entry($_SESSION['ldap']->server(), $result);
$attr_old = ldap_get_attributes($_SESSION['ldap']->server(), $entry);
$success = ldap_add($_SESSION['ldap']->server(),$values->general_dn, $attr_old);
if ($success) $success = ldap_delete($_SESSION['ldap']->server(),$values_old->general_dn);
if ($success) $success = ldap_mod_replace($_SESSION['ldap']->server(),$values->general_dn, $attr);
}
if (!$success) return 5;
$result = ldap_search($_SESSION['ldap']->server(), $_SESSION['config']->get_GroupSuffix(), 'objectClass=PosixGroup');
$result = ldap_search($_SESSION['ldap']->server(), $_SESSION['config']->get_GroupSuffix(), 'objectClass=PosixGroup', array('memberUid', 'cn'));
$entry = ldap_first_entry($_SESSION['ldap']->server(), $result);
while ($entry) {
$modifygroup=0;
@ -1121,13 +1121,13 @@ function modifyhost($values,$values_old) { // Will modify the LDAP-Account
if ($attr2['memberUid']) {
array_shift($attr2['memberUid']);
foreach ($attr2['memberUid'] as $nam) {
if ( ($nam==$values->general_username) && !in_array($nam, $values->general_groupadd)) {
if ( ($nam==$values->general_username) && !in_array($attr2['cn'][0], $values->general_groupadd)) {
$todelete['memberUid'] = $nam;
$success = ldap_mod_del($_SESSION['ldap']->server(), ldap_get_dn($_SESSION['ldap']->server(), $entry) ,$todelete);
if (!$success) return 5;
}
}
if (!in_array($values->general_username, $attr2['memberUid']) && in_array($attr2['cn'][0], $values->general_groupadd)) {
if (!in_array($values->general_username, $attr2['memberUid']) && in_array($attr2['cn'][0], $values->general_groupadd) && ($attr2['cn'][0]!=$values->general_group)) {
$toadd['memberUid'] = $attr2['memberUid'];
$toadd['memberUid'][] = $values->general_username;
$success = ldap_mod_replace($_SESSION['ldap']->server(), ldap_get_dn($_SESSION['ldap']->server(), $entry), $toadd);
@ -1135,7 +1135,7 @@ function modifyhost($values,$values_old) { // Will modify the LDAP-Account
}
}
else {
if (in_array($attr2['cn'][0], $values->general_groupadd)) {
if (in_array($attr2['cn'][0], $values->general_groupadd) && ($attr2['cn'][0]!=$values->general_group)) {
$toadd['memberUid'] = $values->general_username;
$success = ldap_mod_add($_SESSION['ldap']->server(), ldap_get_dn($_SESSION['ldap']->server(), $entry), $toadd);
if (!$success) return 5;

View File

@ -55,7 +55,7 @@ switch ($_POST['select']) { // Select which part of page should be loaded and ch
else $_SESSION['account']->general_uidNumber = "";
if ($_POST['f_general_group']) $_SESSION['account']->general_group = $_POST['f_general_group'];
if ($_POST['f_general_groupadd']) $_SESSION['account']->general_groupadd = $_POST['f_general_groupadd'];
else $_SESSION['account']->general_groupadd = '';
else $_SESSION['account']->general_groupadd = array('');
if ($_POST['f_general_homedir']) $_SESSION['account']->general_homedir = $_POST['f_general_homedir'];
else $_SESSION['account']->general_homedir = "";
if ($_POST['f_general_shell']) $_SESSION['account']->general_shell = $_POST['f_general_shell'];
@ -655,7 +655,9 @@ switch ($select_local) { // Select which part of page will be loaded
echo _('Account deactivated');
echo '</td>'."\n".'<td><input name="f_unix_deactivated" type="checkbox"';
if ($_SESSION['account']->unix_deactivated) echo ' checked ';
echo '></td></tr>'."\n";
echo '></td><td>
<a href="help.php?HelpNumber=432" target="lamhelp">'._('Help').'</a>
</td></tr>'."\n";
break;
}
echo '<tr><td>
@ -764,38 +766,44 @@ switch ($select_local) { // Select which part of page will be loaded
</td></tr>'."\n";
break;
case 'host':
echo '<input name="f_smb_password_no" type="hidden" value="'.$_SESSION['account']->unix_password_no.'">';
echo '<tr><td>';
echo _('Password doesn\'t expire.');
echo '</td><td><input name="f_smb_flagsX" type="checkbox"';
if ($_SESSION['account']->smb_flagsX) echo ' checked ';
echo '></td></tr><tr><td>';
echo _('Host can change Password');
echo '</td><td><input name="f_smb_pwdcanchange" type="checkbox"';
if ($_SESSION['account']->smb_pwdcanchange) echo ' checked ';
echo '></td></tr><tr><td>';
echo _('Host must change Password');
echo '</td><td><input name="f_smb_pwdmustchange" type="checkbox"';
if ($_SESSION['account']->smb_pwdmustchange) echo ' checked ';
echo '></td></tr><tr><td>';
echo _('Accout is deactivated');
echo '</td><td><input name="f_smb_flagsD" type="checkbox"';
if ($_SESSION['account']->smb_flagsD) echo ' checked ';
echo '></td></tr><tr><td>';
// set smb_flgasW true because account is host
$_SESSION['account']->smb_flagsW = 1;
echo '</td></tr><tr><td>';
echo '<tr><td><input name="f_smb_password_no" type="hidden" value="'.$_SESSION['account']->unix_password_no.'">';
echo _('Password doesn\'t expire.');
echo '</td>'."\n".'<td><input name="f_smb_flagsX" type="checkbox"';
if ($_SESSION['account']->smb_flagsX) echo ' checked ';
echo '></td><td>
<a href="help.php?HelpNumber=429" target="lamhelp">'._('Help').'</a>
</td></tr>'."\n".'<tr><td>';
echo _('Host can change Password');
echo '</td>'."\n".'<td><input name="f_smb_pwdcanchange" type="checkbox"';
if ($_SESSION['account']->smb_pwdcanchange) echo ' checked ';
echo '></td><td>
<a href="help.php?HelpNumber=458" target="lamhelp">'._('Help').'</a>
</td></tr>'."\n".'<tr><td>';
echo _('Host must change Password');
echo '</td>'."\n".'<td><input name="f_smb_pwdmustchange" type="checkbox"';
if ($_SESSION['account']->smb_pwdmustchange) echo ' checked ';
echo '></td><td>
<a href="help.php?HelpNumber=459" target="lamhelp">'._('Help').'</a>
</td></tr>'."\n".'<tr><td>';
echo _('Accout is deactivated');
echo '</td>'."\n".'<td><input name="f_smb_flagsD" type="checkbox"';
if ($_SESSION['account']->smb_flagsD) echo ' checked ';
echo '></td><td>
<a href="help.php?HelpNumber=432" target="lamhelp">'._('Help').'</a>
</td></tr>'."\n".'<tr><td>';
echo '</td></tr>'."\n".'<tr><td>';
echo _('Domain');
echo '</td><td><input name="f_smb_domain" type="text" size="20" maxlength="20" value="' . $_SESSION['account']->smb_domain . '">
</td><td>';
echo _('Windows-Domain of user. Can be left empty.');
echo '</td></tr>';
echo '</td>'."\n".'<td><input name="f_smb_domain" type="text" size="20" maxlength="20" value="' . $_SESSION['account']->smb_domain . '">
</td><td>
<a href="help.php?HelpNumber=460" target="lamhelp">'._('Help').'</a>
</td></tr>'."\n";
break;
}
echo '<tr><td>
<input name="back" type="submit" value="'; echo _('back'); echo '">
</td><td></td><td>
<input name="next" type="submit" value="'; echo _('next'); echo '">
</td></tr>';
echo '<tr><td><input name="back" type="submit" value="'; echo _('back');
echo '"></td><td></td><td><input name="next" type="submit" value="';
echo _('next'); echo '"></td></tr>'."\n";
break;
case 'quota':
// Quota Settings
@ -897,20 +905,20 @@ switch ($select_local) { // Select which part of page will be loaded
echo '<tr><td><input name="select" type="hidden" value="final">';
if ($_SESSION['account_old']) echo _('Modify');
else echo _('Create');
echo '</td></tr>';
echo '</td></tr>'."\n";
switch ( $_SESSION['type2'] ) {
case 'user' :
if (($_SESSION['account_old']) && ($_SESSION['account']->general_uidNumber != $_SESSION['account_old']->general_uidNumber)) {
echo '<tr>';
StatusMessage ('INFO', _('UID-number has changed. You have to run the following command as root in order to change existing file-permissions:'),
'find / -gid ' . $_SESSION['account_old' ]->general_uidNumber . ' -exec chown ' . $_SESSION['account']->general_uidNumber . ' {} \;');
echo '</tr>';
echo '</tr>'."\n";
}
if (($_SESSION['account_old']) && ($_SESSION['account']->general_homedir != $_SESSION['account_old']->general_homedir)) {
echo '<tr>';
StatusMessage ('INFO', _('Home Directory has changed. You have to run the following command as root in order to change the existing homedirectory:'),
'mv ' . $_SESSION['account_old' ]->general_homedir . ' ' . $_SESSION['account']->general_homedir);
echo '</tr>';
echo '</tr>'."\n";
}
break;
case 'group' :
@ -918,13 +926,13 @@ switch ($select_local) { // Select which part of page will be loaded
echo '<tr>';
StatusMessage ('INFO', _('GID-number has changed. You have to run the following command as root in order to change existing file-permissions:'),
'find / -gid ' . $_SESSION['account_old' ]->general_uidNumber . ' -exec chgrp ' . $_SESSION['account']->general_uidNumber . ' {} \;');
echo '</tr>';
echo '</tr>'."\n";
echo '<tr><td>';
echo '<input name="f_final_changegids" type="checkbox"';
if ($_SESSION['final_changegids']) echo ' checked ';
echo ' >';
echo _('Change GID-Number of all users in group to new value');
echo '</td></tr>';
echo '</td></tr>'."\n";
}
break;
case 'host':
@ -932,29 +940,29 @@ switch ($select_local) { // Select which part of page will be loaded
echo '<tr>';
StatusMessage ('INFO', _('UID-number has changed. You have to run the following command as root in order to change existing file-permissions:'),
'find / -gid ' . $_SESSION['account_old' ]->general_uidNumber . ' -exec chown ' . $_SESSION['account']->general_uidNumber . ' {} \;');
echo '</tr>';
echo '</tr>'."\n";
}
break;
}
echo '<tr><td>
<input name="back" type="submit" value="'; echo _('back'); echo '">
</td><td>
</td><td><input name="f_finish_safeProfile" type="text" size="30" maxlength="30">
</td>'."\n".'<td>
</td>'."\n".'<td><input name="f_finish_safeProfile" type="text" size="30" maxlength="30">
<input name="save" type="submit" value="';
echo _('Save Profile');
echo '"><a href="help.php?HelpNumber=457" target="lamhelp">'._('Help').'</a>
</td><td>
</td>'."\n".'<td>
<input name="create" type="submit" value="';
if ($_SESSION['account_old']) echo _('Modify Account');
else echo _('Create Account');
echo '">
</td></tr>';
</td></tr>'."\n";
break;
case 'finish':
// Final Settings
echo '<tr><td><input name="select" type="hidden" value="finish">';
echo _('Success');
echo '</td></tr>';
echo '</td></tr>'."\n";
switch ( $_SESSION['type2'] ) {
case 'user' :
echo '<tr><td>';
@ -964,11 +972,11 @@ switch ($select_local) { // Select which part of page will be loaded
else echo _(' has been created. ');
if (!$_SESSION['account_old'])
{ echo '<input name="createagain" type="submit" value="'; echo _('Create another user'); echo '">'; }
echo '</td><td>
echo '</td>'."\n".'<td>
<input name="outputpdf" type="submit" value="'; echo _('Create PDF-file'); echo '">
</td><td>
<input name="backmain" type="submit" value="'; echo _('Back to userlist'); echo '">
</td></tr>';
</td>'."\n".'<td>
<input name="backmain" type="submit" value="'; echo _('Back to userlist'); echo '">
</td></tr>'."\n";
break;
case 'group' :
echo '<tr><td>';
@ -976,12 +984,12 @@ switch ($select_local) { // Select which part of page will be loaded
echo $_SESSION['account']->general_username;
if ($_SESSION['account_old']) echo _(' has been modified. ');
else echo _(' has been created. ');
echo '</td></tr><tr><td>';
echo '</td></tr>'."\n".'<tr><td>';
if (!$_SESSION['account_old'])
{ echo' <input name="createagain" type="submit" value="'; echo _('Create another group'); echo '">'; }
echo '</td><td></td><td>
<input name="backmain" type="submit" value="'; echo _('Back to grouplist'); echo '">
</td></tr>';
<input name="backmain" type="submit" value="'; echo _('Back to grouplist'); echo '">
</td></tr>'."\n";
break;
case 'host' :
echo '<tr><td>';
@ -989,12 +997,12 @@ switch ($select_local) { // Select which part of page will be loaded
echo $_SESSION['account']->general_username;
if ($_SESSION['account_old']) echo _(' has been modified. ');
else echo _(' has been created. ');
echo '</td></tr><tr><td>';
echo '</td></tr>'."\n".'<tr><td>';
if (!$_SESSION['account_old'])
{ echo '<input name="createagain" type="submit" value="'; echo _('Create another host'); echo '">'; }
echo '</td><td></td><td>
<input name="backmain" type="submit" value="'; echo _('Back to hostlist'); echo '">
</td></tr>';
echo '</td><td>'."\n".'</td><td>
<input name="backmain" type="submit" value="'; echo _('Back to hostlist'); echo '">
</td></tr>'."\n";
break;
}
break;