Quota did't work
Profile weren't saved Started to make code HTML-compliant
This commit is contained in:
		
							parent
							
								
									cdc7acd409
								
							
						
					
					
						commit
						dca6d7def9
					
				|  | @ -1,5 +1,5 @@ | ||||||
| general_group: staff | general_group: staff | ||||||
| general_homedir: /home/$user | general_homedir: /home2/$user | ||||||
| general_shell: /bin/bash | general_shell: /bin/bash | ||||||
| unix_pwdwarn: 10 | unix_pwdwarn: 10 | ||||||
| unix_pwdallowlogin: 10 | unix_pwdallowlogin: 10 | ||||||
|  |  | ||||||
|  | @ -117,7 +117,6 @@ function initvars($type=false,$DN=false) { // This function registers all needes | ||||||
| 			} | 			} | ||||||
| 		 else { | 		 else { | ||||||
| 			if (session_is_registered("account_old")) session_unregister("account_old"); | 			if (session_is_registered("account_old")) session_unregister("account_old"); | ||||||
| 			if ( (($type=='user')||($type=='group')) && ($_SESSION['config']->scriptServer)) $_SESSION['account'] = getquotas($type); |  | ||||||
| 			switch ($type) { | 			switch ($type) { | ||||||
| 				case 'user': | 				case 'user': | ||||||
| 						$_SESSION['account'] = loadUserProfile('default'); | 						$_SESSION['account'] = loadUserProfile('default'); | ||||||
|  | @ -129,6 +128,13 @@ function initvars($type=false,$DN=false) { // This function registers all needes | ||||||
| 						$_SESSION['account'] = loadHostProfile('default'); | 						$_SESSION['account'] = loadHostProfile('default'); | ||||||
| 					break; | 					break; | ||||||
| 				} | 				} | ||||||
|  | 			if ( (($type=='user')||($type=='group')) && ($_SESSION['config']->scriptServer)) { | ||||||
|  | 				$values = getquotas($type); | ||||||
|  | 				if (is_object($values)) { | ||||||
|  | 					while (list($key, $val) = each($values)) // Set only defined values
 | ||||||
|  | 						if ($val) $_SESSION['account']->$key = $val; | ||||||
|  | 					} | ||||||
|  | 				} | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
|  | @ -594,6 +600,13 @@ function loaduser($dn) { // Will load all needed values from an existing account | ||||||
| 	if (substr(str_replace('{CRYPT}', '',$attr['userPassword'][0]),0,1) == '!' ) $return->unix_deactivated=true; | 	if (substr(str_replace('{CRYPT}', '',$attr['userPassword'][0]),0,1) == '!' ) $return->unix_deactivated=true; | ||||||
| 	if ($attr['userPassword'][0]) $return->unix_password = $attr['userPassword'][0]; | 	if ($attr['userPassword'][0]) $return->unix_password = $attr['userPassword'][0]; | ||||||
| 	if ($attr['ntPassword'][0])  $return->smb_password = $attr['ntPassword'][0]; | 	if ($attr['ntPassword'][0])  $return->smb_password = $attr['ntPassword'][0]; | ||||||
|  | 	if ($_SESSION['config']->scriptServer) { | ||||||
|  | 		$values = getquotas('user',$return->general_username); | ||||||
|  | 		if (is_object($values)) { | ||||||
|  | 			while (list($key, $val) = each($values)) // Set only defined values
 | ||||||
|  | 				if ($val) $return->$key = $val; | ||||||
|  | 			} | ||||||
|  | 		} | ||||||
| 	return $return; | 	return $return; | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | @ -667,6 +680,13 @@ function loadgroup($dn) { // Will load all needed values from an existing group | ||||||
| 	if ($attr['memberUid']) $return->general_memberUid = $attr['memberUid']; | 	if ($attr['memberUid']) $return->general_memberUid = $attr['memberUid']; | ||||||
| 	if (is_array($return->general_memberUid)) array_shift($return->general_memberUid); | 	if (is_array($return->general_memberUid)) array_shift($return->general_memberUid); | ||||||
| 	$return->general_dn = $dn; | 	$return->general_dn = $dn; | ||||||
|  | 	if ($_SESSION['config']->scriptServer) { | ||||||
|  | 		$values = getquotas('group',$return->general_username); | ||||||
|  | 		if (is_object($values)) { | ||||||
|  | 			while (list($key, $val) = each($values)) // Set only defined values
 | ||||||
|  | 				if ($val) $return->$key = $val; | ||||||
|  | 			} | ||||||
|  | 		} | ||||||
| 	return $return; | 	return $return; | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | @ -777,7 +797,7 @@ function modifyuser($values,$values_old) { // Will modify the LDAP-Account | ||||||
| 	// Value stored in shadowExpire, days since 1.1.1970
 | 	// 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 ; | 	$date = mktime(10,0,0, $values->unix_pwdexpire_mon, $values->unix_pwdexpire_day, $values->unix_pwdexpire_yea) / 86400 ; | ||||||
| 	settype($date, 'integer'); | 	settype($date, 'integer'); | ||||||
| 	$values->general_dn = 'uid=' . $values->general_username . ',' . $values->get_UserSuffix(); | 	$values->general_dn = 'uid=' . $values->general_username . ',' . $_SESSION['config']->get_UserSuffix(); | ||||||
| 	if ($values->general_username != $values_old->general_username) { | 	if ($values->general_username != $values_old->general_username) { | ||||||
| 		$attr['cn'] = $values->general_username; // posixAccount_req shadowAccount_req sambaAccount_may
 | 		$attr['cn'] = $values->general_username; // posixAccount_req shadowAccount_req sambaAccount_may
 | ||||||
| 		$attr['uid'] = $values->general_username; // posixAccount_req
 | 		$attr['uid'] = $values->general_username; // posixAccount_req
 | ||||||
|  | @ -876,7 +896,7 @@ function modifyuser($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_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 && $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
 | 	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_smbhome!='') && ($values->smb_smbhome!=$values_old->smb_smbhome)) $attr['smbHome'] = $values->smb_smbhome; // sambaAccount_may
 | 	if (($values->smb_smbhome!='') && ($values->smb_smbhome!=$values_old->smb_smbhome)) $attr['smbHome'] = $values->smb_smbhome; // sambaAccount_may
 | ||||||
| 	if (($values->smb_smbhome=='') && ($values->smb_smbhome!=$values_old->smb_smbhome)) $attr_rem['smbHome'] = $values_old->smb_smbhome; // sambaAccount_may
 | 	if (($values->smb_smbhome=='') && ($values->smb_smbhome!=$values_old->smb_smbhome)) $attr_rem['smbHome'] = $values_old->smb_smbhome; // sambaAccount_may
 | ||||||
| 	if (($values->smb_homedrive!='') && ($values->smb_homedrive!=$values_old->smb_homedrive)) $attr['homeDrive'] = $values->smb_homedrive; // sambaAccount_may
 | 	if (($values->smb_homedrive!='') && ($values->smb_homedrive!=$values_old->smb_homedrive)) $attr['homeDrive'] = $values->smb_homedrive; // sambaAccount_may
 | ||||||
|  |  | ||||||
|  | @ -245,20 +245,6 @@ if ( $_POST['create'] ) { // Create-Button was pressed | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| // Write HTML-Header and part of Table
 |  | ||||||
| echo '<html><head><title>'; |  | ||||||
| echo _('Create new Account'); |  | ||||||
| echo '</title> |  | ||||||
| 	<link rel="stylesheet" type="text/css" href="../style/layout.css"> |  | ||||||
| 	<meta http-equiv="pragma" content="no-cache"> |  | ||||||
| 	<meta http-equiv="cache-control" content="no-cache"> |  | ||||||
| 	</head><body> |  | ||||||
| 	<form action="account.php" method="post">'; |  | ||||||
| 	if ($error != "0") StatusMessage('ERROR', _('Invalid Value!'), $error); |  | ||||||
| 	echo '<table rules="all" class="account" width="100%"> |  | ||||||
| 	<tr><td></td></tr>'; |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| if (!$select_local) $select_local='general'; | if (!$select_local) $select_local='general'; | ||||||
| if ($_POST['createagain']) { | if ($_POST['createagain']) { | ||||||
| 	$select_local='general'; | 	$select_local='general'; | ||||||
|  | @ -272,13 +258,78 @@ if ($_POST['load']) $select_local='load'; | ||||||
| if ($_POST['save']) $select_local='save'; | if ($_POST['save']) $select_local='save'; | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | // Write HTML-Header and part of Table
 | ||||||
|  | echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" | ||||||
|  |        "http://www.w3.org/TR/html4/loose.dtd">'; | ||||||
|  | echo '<html><head><title>'; | ||||||
|  | echo _('Create new Account'); | ||||||
|  | echo '</title> | ||||||
|  | 	<link rel="stylesheet" type="text/css" href="../style/layout.css"> | ||||||
|  | 	<meta http-equiv="pragma" content="no-cache"> | ||||||
|  | 	<meta http-equiv="cache-control" content="no-cache"> | ||||||
|  | 	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">'; | ||||||
|  | 
 | ||||||
|  | switch ($select_local) { | ||||||
|  | 	case 'backmain': | ||||||
|  | 		if (session_is_registered("shelllist")) session_unregister("shelllist"); | ||||||
|  | 		if (session_is_registered("account")) session_unregister("account"); | ||||||
|  | 		if (session_is_registered("account_old")) session_unregister("account_old"); | ||||||
|  | 		switch ( $_SESSION['type2'] ) { | ||||||
|  | 			case 'user' : | ||||||
|  | 				if (session_is_registered("type2")) session_unregister("type2"); | ||||||
|  | 				echo '<meta http-equiv="refresh" content="0; URL=lists/listusers.php">'; | ||||||
|  | 				break; | ||||||
|  | 			case 'group' : | ||||||
|  | 				if (session_is_registered("type2")) session_unregister("type2"); | ||||||
|  | 				echo '<meta http-equiv="refresh" content="0; URL=lists/listgroups.php">'; | ||||||
|  | 				break; | ||||||
|  | 			case 'host' : | ||||||
|  | 				if (session_is_registered("type2")) session_unregister("type2"); | ||||||
|  | 				echo '<meta http-equiv="refresh" content="0; URL=lists/listhosts.php">'; | ||||||
|  | 				break; | ||||||
|  | 			} | ||||||
|  | 		break; | ||||||
|  | 	case 'load': | ||||||
|  | 		switch ( $_SESSION['type2'] ) { | ||||||
|  | 			case 'user': | ||||||
|  | 				$_SESSION['account'] = loadUserProfile($_POST['f_general_selectprofile']); | ||||||
|  | 				break; | ||||||
|  | 			case 'host': | ||||||
|  | 				$_SESSION['account'] = loadHostProfile($_POST['f_general_selectprofile']); | ||||||
|  | 				break; | ||||||
|  | 			case 'group': | ||||||
|  | 				$_SESSION['account'] = loadGroupProfile($_POST['f_general_selectprofile']); | ||||||
|  | 				break; | ||||||
|  | 			} | ||||||
|  | 		$select_local='general'; | ||||||
|  | 		break; | ||||||
|  | 	case 'save': | ||||||
|  | 		switch ( $_SESSION['type2'] ) { | ||||||
|  | 			case 'user': | ||||||
|  | 				saveUserProfile($_SESSION['account'], $_POST['f_finish_safeProfile']); | ||||||
|  | 			break; | ||||||
|  | 			case 'host': | ||||||
|  | 				saveHostProfile($_SESSION['account'], $_POST['f_finish_safeProfile']); | ||||||
|  | 			break; | ||||||
|  | 			case 'group': | ||||||
|  | 				saveGroupProfile($_SESSION['account'], $_POST['f_finish_safeProfile']); | ||||||
|  | 			break; | ||||||
|  | 			} | ||||||
|  | 		$select_local='final'; | ||||||
|  | 		break; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	echo '</head><body> | ||||||
|  | 	<form action="account.php" method="post">'; | ||||||
|  | 	if ($error != "0") StatusMessage('ERROR', _('Invalid Value!'), $error); | ||||||
|  | 	echo '<table rules="all" class="account" width="100%">'; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
| switch ($select_local) { | switch ($select_local) { | ||||||
| 	case 'general': | 	case 'general': | ||||||
| 		// General Account Settings
 | 		// General Account Settings
 | ||||||
| 		$groups = findgroups(); | 		$groups = findgroups(); | ||||||
| 		echo ' | 		echo '<tr><td><input name="select" type="hidden" value="general">'; | ||||||
| 		<input name="select" type="hidden" value="general"> |  | ||||||
| 		<tr><td>'; |  | ||||||
| 		echo _('General Properties'); | 		echo _('General Properties'); | ||||||
| 		echo '</td></tr>'; | 		echo '</td></tr>'; | ||||||
| 		switch ( $_SESSION['type2'] ) { | 		switch ( $_SESSION['type2'] ) { | ||||||
|  | @ -309,7 +360,7 @@ switch ($select_local) { | ||||||
| 					if ($_SESSION['account']->general_group == $group) echo '<option selected>' . $group; | 					if ($_SESSION['account']->general_group == $group) echo '<option selected>' . $group; | ||||||
| 					else echo '<option>' . $group; | 					else echo '<option>' . $group; | ||||||
| 					 } | 					 } | ||||||
| 				echo '</td></tr><tr><td>'; | 				echo '</select></td></tr><tr><td>'; | ||||||
| 				echo _('Additional Groupmembership'); | 				echo _('Additional Groupmembership'); | ||||||
| 				echo '</td><td><select name="f_general_groupadd[]" size="3" multiple>'; | 				echo '</td><td><select name="f_general_groupadd[]" size="3" multiple>'; | ||||||
| 				foreach ($groups as $group) { | 				foreach ($groups as $group) { | ||||||
|  | @ -362,7 +413,7 @@ switch ($select_local) { | ||||||
| 				echo '</td><td><input name="f_general_gecos" type="text" size="30" value="' . $_SESSION['account']->general_gecos . '">
 | 				echo '</td><td><input name="f_general_gecos" type="text" size="30" value="' . $_SESSION['account']->general_gecos . '">
 | ||||||
| 					</td><td>'; | 					</td><td>'; | ||||||
| 				echo _('User descriptopn. If left empty groupname will be used.'); | 				echo _('User descriptopn. If left empty groupname will be used.'); | ||||||
| 				echo '</td></tr><tr><td><select name="f_general_selectprofile">'; | 				echo '</td></tr><tr><td><select name="f_general_selectprofile" >'; | ||||||
| 				foreach ($profilelist as $profile) echo '<option>' . $profile; | 				foreach ($profilelist as $profile) echo '<option>' . $profile; | ||||||
| 				echo '</select> | 				echo '</select> | ||||||
| 				<input name="load" type="submit" value="'; echo _('Load Profile'); echo '"> | 				<input name="load" type="submit" value="'; echo _('Load Profile'); echo '"> | ||||||
|  | @ -387,7 +438,7 @@ switch ($select_local) { | ||||||
| 					if ($_SESSION['account']->general_group == $group) echo '<option selected>' . $group; | 					if ($_SESSION['account']->general_group == $group) echo '<option selected>' . $group; | ||||||
| 					else echo '<option>' . $group; | 					else echo '<option>' . $group; | ||||||
| 					 } | 					 } | ||||||
| 				echo '</td></tr><tr><td>'; | 				echo '</select></td></tr><tr><td>'; | ||||||
| 				echo _('Additional Groupmembership'); | 				echo _('Additional Groupmembership'); | ||||||
| 				echo '</td><td><select name="f_general_groupadd[]" size="3" multiple>'; | 				echo '</td><td><select name="f_general_groupadd[]" size="3" multiple>'; | ||||||
| 				foreach ($groups as $group) { | 				foreach ($groups as $group) { | ||||||
|  | @ -417,8 +468,9 @@ switch ($select_local) { | ||||||
| 		break; | 		break; | ||||||
| 	case 'unix': | 	case 'unix': | ||||||
| 		// Unix Password Settings
 | 		// Unix Password Settings
 | ||||||
| 		echo '<input name="select" type="hidden" value="unix">'; | 		echo '<tr><td><input name="select" type="hidden" value="unix">'; | ||||||
| 		echo '<tr><td>Unix Properties</td></tr>'; | 		echo _('Unix Properties'); | ||||||
|  | 		echo '</td></tr>'; | ||||||
| 		switch ( $_SESSION['type2'] ) { | 		switch ( $_SESSION['type2'] ) { | ||||||
| 			case 'user' : | 			case 'user' : | ||||||
| 				echo '<tr><td>'; | 				echo '<tr><td>'; | ||||||
|  | @ -542,8 +594,7 @@ switch ($select_local) { | ||||||
| 		break; | 		break; | ||||||
| 	case 'samba': | 	case 'samba': | ||||||
| 		// Samba Settings
 | 		// Samba Settings
 | ||||||
| 		echo '<input name="select" type="hidden" value="samba">'; | 		echo '<tr><td><input name="select" type="hidden" value="samba">'; echo _('Samba Properties'); echo '</td></tr>'; | ||||||
| 		echo '<tr><td>'; echo _('Samba Properties'); echo '</td></tr>'; |  | ||||||
| 		switch ( $_SESSION['type2'] ) { | 		switch ( $_SESSION['type2'] ) { | ||||||
| 			case 'user': | 			case 'user': | ||||||
| 				echo '<tr><td>'; | 				echo '<tr><td>'; | ||||||
|  | @ -665,7 +716,7 @@ switch ($select_local) { | ||||||
| 		break; | 		break; | ||||||
| 	case 'quota': | 	case 'quota': | ||||||
| 		// Quota Settings
 | 		// Quota Settings
 | ||||||
| 		echo '<input name="select" type="hidden" value="quota"><tr><td>'; | 		echo '<tr><td><input name="select" type="hidden" value="quota">'; | ||||||
| 		echo _('Quota Properties'); | 		echo _('Quota Properties'); | ||||||
| 		echo '</td></tr><tr><td>'; echo _('Mointpoint'); echo '</td><td>'; echo _('used blocks'); echo '</td><td>'; | 		echo '</td></tr><tr><td>'; echo _('Mointpoint'); echo '</td><td>'; echo _('used blocks'); echo '</td><td>'; | ||||||
| 		echo _('soft block limit'); echo '</td><td>'; echo _('hard block limit'); echo '</td><td>'; echo _('grace block period'); | 		echo _('soft block limit'); echo '</td><td>'; echo _('hard block limit'); echo '</td><td>'; echo _('grace block period'); | ||||||
|  | @ -691,8 +742,7 @@ switch ($select_local) { | ||||||
| 		break; | 		break; | ||||||
| 	case 'personal': | 	case 'personal': | ||||||
| 		// Personal Settings
 | 		// Personal Settings
 | ||||||
| 		echo '<input name="select" type="hidden" value="personal"> | 		echo '<tr><td><input name="select" type="hidden" value="personal">'; | ||||||
| 		<tr><td>'; |  | ||||||
| 		echo _('Personal Properties'); | 		echo _('Personal Properties'); | ||||||
| 		echo '</td></tr><tr><td>'; | 		echo '</td></tr><tr><td>'; | ||||||
| 		echo _('Title'); | 		echo _('Title'); | ||||||
|  | @ -740,8 +790,7 @@ switch ($select_local) { | ||||||
| 		break; | 		break; | ||||||
| 	case 'final': | 	case 'final': | ||||||
| 		// Final Settings
 | 		// Final Settings
 | ||||||
| 		echo '<input name="select" type="hidden" value="final"> | 		echo '<tr><td><input name="select" type="hidden" value="final">'; | ||||||
| 		<tr><td>'; |  | ||||||
| 		if ($_SESSION['account_old']) echo _('Modify'); | 		if ($_SESSION['account_old']) echo _('Modify'); | ||||||
| 		 else echo _('Create'); | 		 else echo _('Create'); | ||||||
| 		echo '</td></tr>'; | 		echo '</td></tr>'; | ||||||
|  | @ -786,12 +835,10 @@ switch ($select_local) { | ||||||
| 		echo '<tr><td>'; | 		echo '<tr><td>'; | ||||||
| 		echo '<input name="back" type="submit" value="'; echo _('back'); echo '">
 | 		echo '<input name="back" type="submit" value="'; echo _('back'); echo '">
 | ||||||
| 		</td><td>'; | 		</td><td>'; | ||||||
| 		if (($_SESSION['type2']=='user') || ($_SESSION['type2']=='host')) { | 		echo '</td><td><input name="f_finish_safeProfile" type="text" size="30" maxlength="30"> | ||||||
| 			echo '</td><td><input name="f_finish_safeProfile" type="text" size="30" maxlength="30"> | 			<input name="save" type="submit" value="';
 | ||||||
| 				<input name="save" type="submit" value="';
 | 		echo _('Save Profile'); | ||||||
| 			echo _('Save Profile'); | 		echo '">'; | ||||||
| 			echo '">'; |  | ||||||
| 			} |  | ||||||
| 		echo '</td><td> | 		echo '</td><td> | ||||||
| 		<input name="create" type="submit" value="';
 | 		<input name="create" type="submit" value="';
 | ||||||
| 		if ($_SESSION['account_old']) echo _('Modify Account'); | 		if ($_SESSION['account_old']) echo _('Modify Account'); | ||||||
|  | @ -801,8 +848,7 @@ switch ($select_local) { | ||||||
| 		break; | 		break; | ||||||
| 	case 'finish': | 	case 'finish': | ||||||
| 		// Final Settings
 | 		// Final Settings
 | ||||||
| 		echo '<input name="select" type="hidden" value="finish"> | 		echo '<tr><td><input name="select" type="hidden" value="finish">'; | ||||||
| 		<tr><td>'; |  | ||||||
| 		echo _('Success'); | 		echo _('Success'); | ||||||
| 		echo '</td></tr>'; | 		echo '</td></tr>'; | ||||||
| 		switch ( $_SESSION['type2'] ) { | 		switch ( $_SESSION['type2'] ) { | ||||||
|  | @ -848,52 +894,8 @@ switch ($select_local) { | ||||||
| 				break; | 				break; | ||||||
| 			} | 			} | ||||||
| 		break; | 		break; | ||||||
| 	case 'backmain': |  | ||||||
| 		if (session_is_registered("shelllist")) session_unregister("shelllist"); |  | ||||||
| 		if (session_is_registered("account")) session_unregister("account"); |  | ||||||
| 		if (session_is_registered("account_old")) session_unregister("account_old"); |  | ||||||
| 		switch ( $_SESSION['type2'] ) { |  | ||||||
| 			case 'user' : |  | ||||||
| 				if (session_is_registered("type2")) session_unregister("type2"); |  | ||||||
| 				echo '<meta http-equiv="refresh" content="0; URL=lists/listusers.php">'; |  | ||||||
| 				break; |  | ||||||
| 			case 'group' : |  | ||||||
| 				if (session_is_registered("type2")) session_unregister("type2"); |  | ||||||
| 				echo '<meta http-equiv="refresh" content="0; URL=lists/listgroups.php">'; |  | ||||||
| 				break; |  | ||||||
| 			case 'host' : |  | ||||||
| 				if (session_is_registered("type2")) session_unregister("type2"); |  | ||||||
| 				echo '<meta http-equiv="refresh" content="0; URL=lists/listhosts.php">'; |  | ||||||
| 				break; |  | ||||||
| 			} |  | ||||||
| 		break; |  | ||||||
| 	case 'load': |  | ||||||
| 		switch ( $_SESSION['type2'] ) { |  | ||||||
| 			case 'user': |  | ||||||
| 				$_SESSION['account'] = loadUserProfile($_POST['f_general_selectprofile']); |  | ||||||
| 				break; |  | ||||||
| 			case 'host': |  | ||||||
| 				$_SESSION['account'] = loadHostProfile($_POST['f_general_selectprofile']); |  | ||||||
| 				break; |  | ||||||
| 			case 'group': |  | ||||||
| 				$_SESSION['account'] = loadGroupProfile($_POST['f_general_selectprofile']); |  | ||||||
| 				break; |  | ||||||
| 			} |  | ||||||
| 		echo '<meta http-equiv="refresh" content="0; URL=account.php">'; |  | ||||||
| 		break; |  | ||||||
| 	case 'save': |  | ||||||
| 		switch ( $_SESSION['type2'] ) { |  | ||||||
| 			case 'user': |  | ||||||
| 				saveUserProfile($_SESSION['account'], $f_finish_safeProfile); |  | ||||||
| 			break; |  | ||||||
| 			case 'host': |  | ||||||
| 				saveHostProfile($_SESSION['account'], $f_finish_safeProfile); |  | ||||||
| 			break; |  | ||||||
| 			} |  | ||||||
| 		echo '<meta http-equiv="refresh" content="0; URL=account.php?select=final">'; |  | ||||||
| 		break; |  | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| // Print end of HTML-Page
 | // Print end of HTML-Page
 | ||||||
| echo '</form></body></html>'; | echo '</table></form></body></html>'; | ||||||
| ?>
 | ?>
 | ||||||
|  |  | ||||||
|  | @ -28,14 +28,16 @@ include_once('../lib/config.inc'); | ||||||
| session_save_path('../sess'); | session_save_path('../sess'); | ||||||
| @session_start(); | @session_start(); | ||||||
| 
 | 
 | ||||||
| 
 | echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" | ||||||
|  |        "http://www.w3.org/TR/html4/loose.dtd">'; | ||||||
| echo '<html><head><title>'; | echo '<html><head><title>'; | ||||||
| echo _('Delete Account'); | echo _('Delete Account'); | ||||||
| echo '</title> | echo '</title> | ||||||
| 	</head> |  | ||||||
| 	<link rel="stylesheet" type="text/css" href="../style/layout.css"> | 	<link rel="stylesheet" type="text/css" href="../style/layout.css"> | ||||||
| 	<meta http-equiv="pragma" content="no-cache"> | 	<meta http-equiv="pragma" content="no-cache"> | ||||||
| 	<meta http-equiv="cache-control" content="no-cache"> | 	<meta http-equiv="cache-control" content="no-cache"> | ||||||
|  | 	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> | ||||||
|  | 	</head> | ||||||
| 	<body> | 	<body> | ||||||
| 	<form action="delete.php" method="post"> | 	<form action="delete.php" method="post"> | ||||||
| 	<table rules="all" class="delete" width="100%"> | 	<table rules="all" class="delete" width="100%"> | ||||||
|  | @ -58,7 +60,7 @@ if ($_GET['type']) { | ||||||
| 		} | 		} | ||||||
| 	echo '</td></tr>'; | 	echo '</td></tr>'; | ||||||
| 	foreach ($DN2 as $dn) echo '<tr><td>'.$dn.'</td></tr>'; | 	foreach ($DN2 as $dn) echo '<tr><td>'.$dn.'</td></tr>'; | ||||||
| 	echo '<br><tr><td> | 	echo '<tr><td><br></td></tr><tr><td> | ||||||
| 	<input name="delete_yes" type="submit" value="';
 | 	<input name="delete_yes" type="submit" value="';
 | ||||||
| 	echo _('Commit'); echo '"></td><td></td><td>
 | 	echo _('Commit'); echo '"></td><td></td><td>
 | ||||||
| 	<input name="delete_no" type="submit" value="';
 | 	<input name="delete_no" type="submit" value="';
 | ||||||
|  | @ -121,5 +123,5 @@ if ($_POST['delete_yes']) { | ||||||
| if ($_POST['delete_no']) echo _('Nothing was deleted.'); | if ($_POST['delete_no']) echo _('Nothing was deleted.'); | ||||||
| 
 | 
 | ||||||
| echo '</td></tr>'; | echo '</td></tr>'; | ||||||
| echo '</form></body></html>'; | echo '</table></form></body></html>'; | ||||||
| ?>
 | ?>
 | ||||||
|  |  | ||||||
|  | @ -42,13 +42,24 @@ if (!$select) $select='main'; | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| // Write HTML-Header and part of Table
 | // Write HTML-Header and part of Table
 | ||||||
|  | echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" | ||||||
|  |        "http://www.w3.org/TR/html4/loose.dtd">'; | ||||||
| echo '<html><head><title>'; | echo '<html><head><title>'; | ||||||
| echo _('Create new Accounts'); | echo _('Create new Accounts'); | ||||||
| echo '</title> | echo '</title> | ||||||
| 	<link rel="stylesheet" type="text/css" href="../style/layout.css"> | 	<link rel="stylesheet" type="text/css" href="../style/layout.css"> | ||||||
| 	<meta http-equiv="pragma" content="no-cache"> | 	<meta http-equiv="pragma" content="no-cache"> | ||||||
| 	<meta http-equiv="cache-control" content="no-cache"> | 	<meta http-equiv="cache-control" content="no-cache"> | ||||||
| 	</head><body> | 	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">'; | ||||||
|  | 
 | ||||||
|  | switch ($select) { | ||||||
|  | 	case 'cancel': | ||||||
|  | 		if ( session_is_registered("accounts")) session_unregister("accounts"); | ||||||
|  | 		echo '<meta http-equiv="refresh" content="0; URL=lists/listusers.php">'; | ||||||
|  | 		break; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | echo	'</head><body> | ||||||
| 	<form enctype="multipart/form-data" action="masscreate.php" method="post">'; | 	<form enctype="multipart/form-data" action="masscreate.php" method="post">'; | ||||||
| 	echo '<table rules="all" class="masscreate" width="100%"> | 	echo '<table rules="all" class="masscreate" width="100%"> | ||||||
| 	<tr><td></td></tr>'; | 	<tr><td></td></tr>'; | ||||||
|  | @ -58,8 +69,7 @@ switch ($select) { | ||||||
| 		if ( session_is_registered("accounts")) session_unregister("accounts"); | 		if ( session_is_registered("accounts")) session_unregister("accounts"); | ||||||
| 		session_register("accounts"); | 		session_register("accounts"); | ||||||
| 		$profilelist = getUserProfiles(); | 		$profilelist = getUserProfiles(); | ||||||
| 		echo '<input name="select" type="hidden" value="main">'; | 		echo '<tr><td><input name="select" type="hidden" value="main">'; | ||||||
| 		echo '<tr><td>'; |  | ||||||
| 		echo _('Mass Creation'); | 		echo _('Mass Creation'); | ||||||
| 		echo '</td></tr><tr><td>'; | 		echo '</td></tr><tr><td>'; | ||||||
| 		echo _('Please provide a csv-file with the following syntax. Values with * are required:'); | 		echo _('Please provide a csv-file with the following syntax. Values with * are required:'); | ||||||
|  | @ -112,6 +122,7 @@ switch ($select) { | ||||||
| 			if (is_object($values)) { | 			if (is_object($values)) { | ||||||
| 				while (list($key, $val) = each($values)) // Set only defined values
 | 				while (list($key, $val) = each($values)) // Set only defined values
 | ||||||
| 					if ($val) $_SESSION['accounts'][$row]->$key = $val; | 					if ($val) $_SESSION['accounts'][$row]->$key = $val; | ||||||
|  | 				$_SESSION['accounts'][$row]->general_uidNumber=""; | ||||||
| 				} | 				} | ||||||
| 				else $error = $values; | 				else $error = $values; | ||||||
| 			if (!$error) { | 			if (!$error) { | ||||||
|  | @ -170,10 +181,6 @@ switch ($select) { | ||||||
| 		echo '</td><td><input name="cancel" type="submit" value="'; echo _('Cancel'); echo '">'; | 		echo '</td><td><input name="cancel" type="submit" value="'; echo _('Cancel'); echo '">'; | ||||||
| 		echo '</td><td><input name="create" type="submit" value="'; echo _('Create'); echo '">'; | 		echo '</td><td><input name="create" type="submit" value="'; echo _('Create'); echo '">'; | ||||||
| 		break; | 		break; | ||||||
| 	case 'cancel': |  | ||||||
| 		if ( session_is_registered("accounts")) session_unregister("accounts"); |  | ||||||
| 		echo '<meta http-equiv="refresh" content="0; URL=lists/listusers.php">'; |  | ||||||
| 		break; |  | ||||||
| 	case 'create': | 	case 'create': | ||||||
| 		$row=0; | 		$row=0; | ||||||
| 		$stay=true; | 		$stay=true; | ||||||
|  | @ -185,6 +192,7 @@ switch ($select) { | ||||||
| 				$group->general_gecos=$_SESSION['accounts'][$row]->general_group; | 				$group->general_gecos=$_SESSION['accounts'][$row]->general_group; | ||||||
| 				creategroup($group); | 				creategroup($group); | ||||||
| 				} | 				} | ||||||
|  | 			$_SESSION['accounts'][$row]->general_uidNumber = checkid($_SESSION['accounts'][$row], 'user'); | ||||||
| 			$error = createuser($_SESSION['accounts'][$row]); | 			$error = createuser($_SESSION['accounts'][$row]); | ||||||
| 			if ($error==1) $row++; | 			if ($error==1) $row++; | ||||||
| 				else { | 				else { | ||||||
|  | @ -204,5 +212,5 @@ switch ($select) { | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| echo '</form></body></html>'; | echo '</table></form></body></html>'; | ||||||
| ?>
 | ?>
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue