changed RIDs 4 groups

This commit is contained in:
katagia 2003-08-13 17:15:52 +00:00
parent 2a7f74d0f9
commit 78eb6b0d4b
3 changed files with 17 additions and 21 deletions

View File

@ -306,10 +306,8 @@ $helpArray = array (
"Text" => _("Suffix")), "Text" => _("Suffix")),
"463" => array ("ext" => "FALSE", "Headline" => _("Suffix"), "463" => array ("ext" => "FALSE", "Headline" => _("Suffix"),
"Text" => _("Suffix")), "Text" => _("Suffix")),
"464" => array ("ext" => "FALSE", "Headline" => _("Windows well known group"), "464" => array ("ext" => "FALSE", "Headline" => _("Windows groupname"),
"Text" => _("Windows well known group")), "Text" => _("If you want to use a well known RID you can selcet a well known group.")),
"465" => array ("ext" => "FALSE", "Headline" => _("Windows groupname"),
"Text" => _("Windows groupname")),
"466" => array ("ext" => "FALSE", "Headline" => _("Unix workstations"), "466" => array ("ext" => "FALSE", "Headline" => _("Unix workstations"),
"Text" => _("Komma-separated list of unix workstations the user is allowed to login. Empty means every workstation. Can be left empty.")), "Text" => _("Komma-separated list of unix workstations the user is allowed to login. Empty means every workstation. Can be left empty.")),
// 600 - 699 // 600 - 699

View File

@ -64,7 +64,6 @@ class account { // This class keeps all needed values for any account
var $smb_flagsD; // string (1|0) account is disabled? (user|host) var $smb_flagsD; // string (1|0) account is disabled? (user|host)
var $smb_flagsX; // string (1|0) password doesn'T expire (user|host) var $smb_flagsX; // string (1|0) password doesn'T expire (user|host)
var $smb_mapgroup; // decimal ID for groups var $smb_mapgroup; // decimal ID for groups
var $smb_displayName; // GRoupname displayed by samba
// Quota Settins // Quota Settins
var $quota; // array[][] First array is an index for every chare with active quotas var $quota; // array[][] First array is an index for every chare with active quotas
// second array Contains values for every share: // second array Contains values for every share:
@ -871,7 +870,6 @@ function loadgroup($dn) { // Will load all needed values from an existing group
for ($i=0; $i<sizeof($samba3domains); $i++) for ($i=0; $i<sizeof($samba3domains); $i++)
if ($SID == $samba3domains[$i]->SID) $return->smb_domain = $samba3domains[$i]; if ($SID == $samba3domains[$i]->SID) $return->smb_domain = $samba3domains[$i];
} }
if (isset($attr['displayName'][0])) $return->smb_displayName = $attr['displayName'][0];
if ($_SESSION['config']->scriptServer) { if ($_SESSION['config']->scriptServer) {
$values = getquotas('group',$return->general_username); $values = getquotas('group',$return->general_username);
if (is_object($values)) { if (is_object($values)) {
@ -1526,7 +1524,7 @@ function creategroup($values) { // Will create the LDAP-Group
$attr['objectClass'][1] = 'sambaGroupMapping'; $attr['objectClass'][1] = 'sambaGroupMapping';
$attr['sambaSID'] = $values->smb_mapgroup; $attr['sambaSID'] = $values->smb_mapgroup;
$attr['sambaGroupType'] = '2'; $attr['sambaGroupType'] = '2';
if ($values->smb_displayName) $attr['displayName'] = $values->smb_displayName; if ($values->general_gecos) $attr['displayName'] = $values->general_gecos;
} }
$success = ldap_add($_SESSION['ldap']->server(),$values->general_dn, $attr); $success = ldap_add($_SESSION['ldap']->server(),$values->general_dn, $attr);
if ($_SESSION['config']->scriptServer) setquotas($values,'group'); if ($_SESSION['config']->scriptServer) setquotas($values,'group');
@ -1558,10 +1556,8 @@ function modifygroup($values,$values_old) { // Will modify the LDAP-Group
if ($_SESSION['config']->samba3 =='yes') { if ($_SESSION['config']->samba3 =='yes') {
if ($values->smb_mapgroup != $values_old->smb_mapgroup) if ($values->smb_mapgroup != $values_old->smb_mapgroup)
$attr['sambaSID'] = $values->smb_mapgroup; $attr['sambaSID'] = $values->smb_mapgroup;
if (($values->smb_displayName!='') && ($values->smb_displayName!=$values_old->smb_displayName)) if ($values->general_gecos!=$values_old->general_gecos)
$attr['displayName'] = $values->smb_displayName; $attr['displayName'] = $values->general_gecos;
if (($values->smb_displayName=='') && ($values->smb_displayName!=$values_old->smb_displayName))
$attr_rem['displayName'] = $values->smb_displayName;
} }
if ($attr_rem) { if ($attr_rem) {
$success = ldap_mod_del($_SESSION['ldap']->server(),$values_old->general_dn, $attr_rem); $success = ldap_mod_del($_SESSION['ldap']->server(),$values_old->general_dn, $attr_rem);

View File

@ -152,8 +152,6 @@ switch ($_POST['select']) { // Select which part of page should be loaded and ch
else $_SESSION['account']->smb_flagsD = false; else $_SESSION['account']->smb_flagsD = false;
if ($_POST['f_smb_flagsX']) $_SESSION['account']->smb_flagsX = true; if ($_POST['f_smb_flagsX']) $_SESSION['account']->smb_flagsX = true;
else $_SESSION['account']->smb_flagsX = false; else $_SESSION['account']->smb_flagsX = false;
if (isset($_POST['f_smb_displayName'])) $_SESSION['account']->smb_displayName = $_POST['f_smb_displayName'];
else $_SESSION['account']->smb_displayName = '';
if ($_SESSION['config']->samba3 == 'yes') { if ($_SESSION['config']->samba3 == 'yes') {
$samba3domains = $_SESSION['ldap']->search_domains($_SESSION[config]->get_domainSuffix()); $samba3domains = $_SESSION['ldap']->search_domains($_SESSION[config]->get_domainSuffix());
@ -164,6 +162,7 @@ switch ($_POST['select']) { // Select which part of page should be loaded and ch
if ($_POST['f_smb_mapgroup'] == _('Domain Guests')) $_SESSION['account']->smb_mapgroup = $_SESSION['account']->smb_domain->SID . "-" . '514'; if ($_POST['f_smb_mapgroup'] == _('Domain Guests')) $_SESSION['account']->smb_mapgroup = $_SESSION['account']->smb_domain->SID . "-" . '514';
if ($_POST['f_smb_mapgroup'] == _('Domain Users')) $_SESSION['account']->smb_mapgroup = $_SESSION['account']->smb_domain->SID . "-" . '513'; if ($_POST['f_smb_mapgroup'] == _('Domain Users')) $_SESSION['account']->smb_mapgroup = $_SESSION['account']->smb_domain->SID . "-" . '513';
if ($_POST['f_smb_mapgroup'] == _('Domain Admins')) $_SESSION['account']->smb_mapgroup = $_SESSION['account']->smb_domain->SID . "-" . '512'; if ($_POST['f_smb_mapgroup'] == _('Domain Admins')) $_SESSION['account']->smb_mapgroup = $_SESSION['account']->smb_domain->SID . "-" . '512';
if ($_POST['f_smb_mapgroup'] == $_SESSION['account']->general_username) $_SESSION['account']->smb_mapgroup = $_SESSION['account']->smb_domain->SID . "-" . $_SESSION['account']->general_uidNumber;
} }
else { else {
if (isset($_POST['f_smb_domain'])) $_SESSION['account']->smb_domain = $_POST['f_smb_domain']; if (isset($_POST['f_smb_domain'])) $_SESSION['account']->smb_domain = $_POST['f_smb_domain'];
@ -787,7 +786,7 @@ switch ($select_local) { // Select which part of page will be loaded
echo '</select></td>'."\n".'<td>'. echo '</select></td>'."\n".'<td>'.
'<a href="help.php?HelpNumber=433" target="lamhelp">'._('Help').'</a>'. '<a href="help.php?HelpNumber=433" target="lamhelp">'._('Help').'</a>'.
'</td></tr>'."\n".'<tr><td>'; '</td></tr>'."\n".'<tr><td>';
echo _('smb home'); echo _('Home path');
echo '</td>'."\n".'<td><input name="f_smb_smbhome" type="text" size="20" maxlength="80" value="' . $_SESSION['account']->smb_smbhome . '">'. echo '</td>'."\n".'<td><input name="f_smb_smbhome" type="text" size="20" maxlength="80" value="' . $_SESSION['account']->smb_smbhome . '">'.
'</td>'."\n".'<td>'. '</td>'."\n".'<td>'.
'<a href="help.php?HelpNumber=437" target="lamhelp">'._('Help').'</a>'. '<a href="help.php?HelpNumber=437" target="lamhelp">'._('Help').'</a>'.
@ -826,8 +825,17 @@ switch ($select_local) { // Select which part of page will be loaded
break; break;
case 'group': case 'group':
echo '<tr><td>'; echo '<tr><td>';
echo _('Windows well known group'); echo _('Windows groupname');
echo '</td>'."\n".'<td><select name="f_smb_mapgroup" >'; echo '</td>'."\n".'<td><select name="f_smb_mapgroup" >';
if ( $_SESSION['account']->smb_mapgroup == $_SESSION['account']->smb_domain->SID . "-" . $_SESSION['account']->uidNumber ) {
echo '<option selected> ';
echo $_SESSION['account']->general_username;
echo "</option>\n"; }
else {
echo '<option> ';
echo $_SESSION['account']->general_username;
echo "</option>\n";
}
if ( $_SESSION['account']->smb_mapgroup == $_SESSION['account']->smb_domain->SID . "-" . '514' ) { if ( $_SESSION['account']->smb_mapgroup == $_SESSION['account']->smb_domain->SID . "-" . '514' ) {
echo '<option selected> '; echo '<option selected> ';
echo _('Domain Guests'); echo _('Domain Guests');
@ -858,12 +866,6 @@ switch ($select_local) { // Select which part of page will be loaded
echo '</select></td>'."\n".'<td>'. echo '</select></td>'."\n".'<td>'.
'<a href="help.php?HelpNumber=464" target="lamhelp">'._('Help').'</a>'. '<a href="help.php?HelpNumber=464" target="lamhelp">'._('Help').'</a>'.
'</td></tr>'."\n".'<tr><td>'; '</td></tr>'."\n".'<tr><td>';
echo _('Windows Groupname');
echo '</td><td>'.
'<input name="f_smb_displayName" type="text" size="30" maxlength="80" value="' . $_SESSION['account']->smb_displayName . '">'.
'</td><td>'.
'<a href="help.php?HelpNumber=465" target="lamhelp">'._('Help').'</a>'.
'</td></tr>'."\n".'<tr><td>';
echo _('Domain'); echo _('Domain');
echo '</td><td><select name="f_smb_domain">'; echo '</td><td><select name="f_smb_domain">';
for ($i=0; $i<sizeof($samba3domains); $i++) { for ($i=0; $i<sizeof($samba3domains); $i++) {