Location: PHPKode > projects > O - OpenSource GroupWare > osgw/admin/admin.php
<?php
/**************************************************************************
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.

   @Authors:	Ryan Thompson(hide@address.com)
***************************************************************************/


if(isset($_POST['save_settings']))
{
	foreach($_POST['setting'] AS $key => $value)
	{
		$sql = "UPDATE o_settings SET value='$value' WHERE setting_id='$key'";
		$db->query($sql);
	}
	
}

$sql = "SELECT * FROM o_settings";
$db->query($sql);
while($db->fetch_results())
{
	$values[$db->record['setting_id']] = $db->record;
	
}
?>
<br />
<form action="<?php echo $_SERVER['PHP_SELF']. "?s=". $_GET['s']?>" method="post">
<table  style="width:400px" align="center">
<tr>
<td class="list_light" style="width:250px"><?php echo $text['auto_generate_passwords']?></td>
<td class="list_light" style="width:150px">

	<input type="radio" name="setting[9]" value="TRUE"
	<?php 
	if($values[9]['value'] == "TRUE")
	{
		echo " checked=\"checked\"";
	}?>>Yes <br />
	<input type="radio" name="setting[9]" value="FALSE"
	<?php 
	if($values[9]['value'] == "FALSE")
	{
		echo " checked=\"checked\"";
	}?>>No
</td>
</tr>
<tr>
<td class="list_dark"><?php echo $text['max_failed_logins']?></td>
<td class="list_dark"><input type="text" size="2" name="setting[4]" value="<?php echo $values[4]['value']?>"></td>
</tr>
<tr>
<td class="list_light"><?php echo $text['minimum_password_length']?></td>
<td class="list_light"><input type="text" size="2" name="setting[1]" value="<?php echo $values[1]['value']?>"></td>
</tr>
<tr>
<td class="list_dark"><?php echo $text['password_expiry_warning']?> (<?php echo $text['days']?>)</td>
<td class="list_dark"><input type="text" size="2" name="setting[5]" value="<?php echo $values[5]['value']?>"></td>
</tr>
<tr>
<td class="list_light"><?php echo $text['system_language']?></td>
<td class="list_light">
	<select name="setting[7]">
		<?php 
			$sql = "SELECT * FROM o_languages WHERE enabled='1'";
			$db->query($sql);
			while($db->fetch_results())
			{
				echo "<option value=\"{$db->record['lg_id']}\"";
				if($db->record['lg_id'] == $values['7']['value'])
				{
					echo " selected=\"selected\"";
				}
				
				echo ">{$db->record['language']}</option>\n";
			}
		?>
	</select>

</td>
</tr>
<tr>
<td class="list_dark"><?php echo $text['reenable_accounts']?> (<?php echo $text['days']?>)</td>
<td class="list_dark"><input type="text" size="2" name="setting[6]" value="<?php echo $values[6]['value']?>"><?php echo $text['reenable_note']?></td>
</tr>
<tr>
<td><input type="submit" name="save_settings" value="Save Settings" class="button1">
</table>
</form>
Return current item: O - OpenSource GroupWare