| 1 | 1289 | kweitzel | <?php
 | 
      
        | 2 |  |  | /**
 | 
      
        | 3 |  |  |  *
 | 
      
        | 4 |  |  |  * @category        frontend
 | 
      
        | 5 |  |  |  * @package         account
 | 
      
        | 6 |  |  |  * @author          WebsiteBaker Project
 | 
      
        | 7 |  |  |  * @copyright       2004-2009, Ryan Djurovich
 | 
      
        | 8 |  |  |  * @copyright       2009-2010, Website Baker Org. e.V.
 | 
      
        | 9 |  |  |  * @link			http://www.websitebaker2.org/
 | 
      
        | 10 |  |  |  * @license         http://www.gnu.org/licenses/gpl.html
 | 
      
        | 11 |  |  |  * @platform        WebsiteBaker 2.8.x
 | 
      
        | 12 |  |  |  * @requirements    PHP 4.3.4 and higher
 | 
      
        | 13 |  |  |  * @version         $Id$
 | 
      
        | 14 |  |  |  * @filesource		$HeadURL$
 | 
      
        | 15 |  |  |  * @lastmodified    $Date$
 | 
      
        | 16 |  |  |  *
 | 
      
        | 17 |  |  |  */
 | 
      
        | 18 |  |  | 
 | 
      
        | 19 |  |  | if(!defined('WB_URL')) die(header('Location: ../../index.php'));
 | 
      
        | 20 |  |  | 
 | 
      
        | 21 |  |  | ?>
 | 
      
        | 22 |  |  | 
 | 
      
        | 23 |  |  | <h2> <?php print $HEADING['MY_SETTINGS']; ?></h2>
 | 
      
        | 24 |  |  | 
 | 
      
        | 25 |  |  | <form name="user" action="<?php print WB_URL.'/account/preferences.php'; ?>" method="post" style="margin-bottom: 5px;">
 | 
      
        | 26 |  |  | <input type="hidden" name="user_id" value="{USER_ID}" />
 | 
      
        | 27 |  |  | 
 | 
      
        | 28 |  |  | <table cellpadding="5" cellspacing="0" border="0" width="97%">
 | 
      
        | 29 |  |  | <tr>
 | 
      
        | 30 |  |  | 	<td width="140"><?php print $TEXT['DISPLAY_NAME']; ?>:</td>
 | 
      
        | 31 |  |  | 	<td class="value_input">
 | 
      
        | 32 |  |  | 		<input type="text" name="display_name" style="width: 380px;" maxlength="255" value="<?php print $wb->get_display_name(); ?>" />
 | 
      
        | 33 |  |  | 	</td>
 | 
      
        | 34 |  |  | </tr>
 | 
      
        | 35 |  |  | <tr>
 | 
      
        | 36 |  |  | 	<td><?php print $TEXT['LANGUAGE']; ?>:</td>
 | 
      
        | 37 |  |  | 	<td>
 | 
      
        | 38 |  |  | 		<select name="language" style="width: 380px;">
 | 
      
        | 39 |  |  | 		<?php
 | 
      
        | 40 |  |  | 		/**
 | 
      
        | 41 |  |  | 		 *
 | 
      
        | 42 |  |  | 		 *	Getting the languages from the database. (addons)
 | 
      
        | 43 |  |  | 		 *	It's a little bit corious, but the language-shortform is
 | 
      
        | 44 |  |  | 		 *	storred in the field "directory" ...
 | 
      
        | 45 |  |  | 		 *
 | 
      
        | 46 |  |  | 		 */
 | 
      
        | 47 |  |  | 		$query = "SELECT directory, name from ".TABLE_PREFIX."addons where type='language' order by 'name'";
 | 
      
        | 48 |  |  | 		$result = $database->query($query);
 | 
      
        | 49 |  |  | 		if ($result) {
 | 
      
        | 50 |  |  | 			$options_html = "";
 | 
      
        | 51 |  |  | 			while($data = $result->fetchRow()) {
 | 
      
        | 52 |  |  | 				$sel = ($data['directory'] == LANGUAGE) ? " selected=\"selected\" " : "";
 | 
      
        | 53 |  |  | 				$options_html .= "<option value=\"".$data['directory']."\" ".$sel.">".$data['name']." (".$data['directory'].")</option>\n";
 | 
      
        | 54 |  |  | 			}
 | 
      
        | 55 |  |  | 			echo $options_html;
 | 
      
        | 56 |  |  | 		}
 | 
      
        | 57 |  |  | 		?>
 | 
      
        | 58 |  |  | 		</select>
 | 
      
        | 59 |  |  | 	</td>
 | 
      
        | 60 |  |  | </tr>
 | 
      
        | 61 |  |  | <tr>
 | 
      
        | 62 |  |  | 	<td><?php print $TEXT['TIMEZONE']; ?>:</td>
 | 
      
        | 63 |  |  | 	<td>
 | 
      
        | 64 |  |  | 		<select name="timezone" style="width: 380px;">
 | 
      
        | 65 |  |  | 			<option value="-20"><?php print $TEXT['PLEASE_SELECT']; ?>...</option>
 | 
      
        | 66 |  |  | 			<?php
 | 
      
        | 67 |  |  | 				// Insert default timezone values
 | 
      
        | 68 |  |  | 				require_once(ADMIN_PATH.'/interface/timezones.php');
 | 
      
        | 69 |  |  | 				$test_time = $wb->get_timezone();
 | 
      
        | 70 |  |  | 				$options_html = "";
 | 
      
        | 71 |  |  | 				foreach($TIMEZONES as $hour_offset => $title) {
 | 
      
        | 72 |  |  | 					$sel = ($test_time == $hour_offset*60*60) ? " selected=\"selected\" " : "";
 | 
      
        | 73 |  |  | 					$options_html .= "<option value=\"".$hour_offset."\" ".$sel.">".$title."</option>\n";
 | 
      
        | 74 |  |  | 				}
 | 
      
        | 75 |  |  | 				print $options_html;
 | 
      
        | 76 |  |  | ?>
 | 
      
        | 77 |  |  | 
 | 
      
        | 78 |  |  | 		</select>
 | 
      
        | 79 |  |  | 	</td>
 | 
      
        | 80 |  |  | </tr>
 | 
      
        | 81 |  |  | <tr>
 | 
      
        | 82 |  |  | 	<td><?php print $TEXT['DATE_FORMAT']; ?>:</td>
 | 
      
        | 83 |  |  | 	<td>
 | 
      
        | 84 |  |  | 		<select name="date_format" style="width: 98%;">
 | 
      
        | 85 |  |  | 			<option value=""><?php print $TEXT['PLEASE_SELECT']; ?>...</option>
 | 
      
        | 86 |  |  | 			<?php
 | 
      
        | 87 |  |  | 			// Insert date format list
 | 
      
        | 88 |  |  | 			$user_time = true;
 | 
      
        | 89 |  |  | 			require_once(ADMIN_PATH.'/interface/date_formats.php');
 | 
      
        | 90 |  |  | 			foreach($DATE_FORMATS AS $format => $title) {
 | 
      
        | 91 |  |  | 				$format = str_replace('|', ' ', $format); // Add's white-spaces (not able to be stored in array key)
 | 
      
        | 92 |  |  | 				if($format != 'system_default') {
 | 
      
        | 93 |  |  | 					$value = $format;
 | 
      
        | 94 |  |  | 				} else {
 | 
      
        | 95 |  |  | 					$value = '';
 | 
      
        | 96 |  |  | 				}
 | 
      
        | 97 |  |  | 				if(DATE_FORMAT == $format AND !isset($_SESSION['USE_DEFAULT_DATE_FORMAT'])) {
 | 
      
        | 98 |  |  | 					$selected = ' selected="selected"';
 | 
      
        | 99 |  |  | 				} elseif($format == 'system_default' AND isset($_SESSION['USE_DEFAULT_DATE_FORMAT'])) {
 | 
      
        | 100 |  |  | 					$selected = ' selected="selected"';
 | 
      
        | 101 |  |  | 				} else {
 | 
      
        | 102 |  |  | 					$selected = '';
 | 
      
        | 103 |  |  | 				}
 | 
      
        | 104 |  |  | 				print '<option value="'.$value.'"'.$selected.'>'.$title.'</option>'."\n";
 | 
      
        | 105 |  |  | 			}
 | 
      
        | 106 |  |  | 			?>
 | 
      
        | 107 |  |  | 		</select>
 | 
      
        | 108 |  |  | 	</td>
 | 
      
        | 109 |  |  | </tr>
 | 
      
        | 110 |  |  | <tr>
 | 
      
        | 111 |  |  | 	<td><?php print $TEXT['TIME_FORMAT']; ?>:</td>
 | 
      
        | 112 |  |  | 	<td>
 | 
      
        | 113 |  |  | 		<select name="time_format" style="width: 98%;">
 | 
      
        | 114 |  |  | 			<option value=""><?php print $TEXT['PLEASE_SELECT']; ?>...</option>
 | 
      
        | 115 |  |  | 			<?php
 | 
      
        | 116 |  |  | 			// Insert time format list
 | 
      
        | 117 |  |  | 			$user_time = true;
 | 
      
        | 118 |  |  | 			require_once(ADMIN_PATH.'/interface/time_formats.php');
 | 
      
        | 119 |  |  | 			foreach($TIME_FORMATS AS $format => $title)
 | 
      
        | 120 |  |  |             {
 | 
      
        | 121 |  |  | 				$format = str_replace('|', ' ', $format); // Add's white-spaces (not able to be stored in array key)
 | 
      
        | 122 |  |  |                 $value = ($format != 'system_default') ? $format : '';
 | 
      
        | 123 |  |  | 
 | 
      
        | 124 |  |  |                 $selected = ((TIME_FORMAT == $format AND ! isset($_SESSION['USE_DEFAULT_TIME_FORMAT']))
 | 
      
        | 125 |  |  |                     OR ($format == 'system_default' AND isset($_SESSION['USE_DEFAULT_TIME_FORMAT'])))
 | 
      
        | 126 |  |  |                 	? ' selected="selected"' : '';
 | 
      
        | 127 |  |  | 
 | 
      
        | 128 |  |  | 				print '<option value="'.$value.'"'.$selected.'>'.$title.'</option>';
 | 
      
        | 129 |  |  | 			}
 | 
      
        | 130 |  |  | 			?>
 | 
      
        | 131 |  |  | 		</select>
 | 
      
        | 132 |  |  | 	</td>
 | 
      
        | 133 |  |  | </tr>
 | 
      
        | 134 |  |  | <tr>
 | 
      
        | 135 |  |  | 	<td> </td>
 | 
      
        | 136 |  |  | 	<td>
 | 
      
        | 137 |  |  | 		<input type="submit" name="submit" value="<?php print $TEXT['SAVE']; ?>" />
 | 
      
        | 138 |  |  | 		<input type="reset" name="reset" value="<?php print $TEXT['RESET']; ?>" />
 | 
      
        | 139 |  |  | 	</td>
 | 
      
        | 140 |  |  | </tr>
 | 
      
        | 141 |  |  | </table>
 | 
      
        | 142 |  |  | 
 | 
      
        | 143 |  |  | </form>
 | 
      
        | 144 |  |  | 
 | 
      
        | 145 |  |  | <h2> <?php print $HEADING['MY_EMAIL']; ?></h2>
 | 
      
        | 146 |  |  | 
 | 
      
        | 147 |  |  | <form name="email" action="<?php print WB_URL.'/account/preferences.php'; ?>" method="post" style="margin-bottom: 5px;">
 | 
      
        | 148 |  |  | <input type="hidden" name="user_id" value="{USER_ID}" />
 | 
      
        | 149 |  |  | 
 | 
      
        | 150 |  |  | <table cellpadding="5" cellspacing="0" border="0" width="97%">
 | 
      
        | 151 |  |  | <tr>
 | 
      
        | 152 |  |  | 	<td width="140"><?php print $TEXT['CURRENT_PASSWORD']; ?>:</td>
 | 
      
        | 153 |  |  | 	<td>
 | 
      
        | 154 |  |  | 		<input type="password" name="current_password" style="width: 380px;" />
 | 
      
        | 155 |  |  | 	</td>
 | 
      
        | 156 |  |  | </tr>
 | 
      
        | 157 |  |  | <tr>
 | 
      
        | 158 |  |  | 	<td><?php print $TEXT['EMAIL']; ?>:</td>
 | 
      
        | 159 |  |  | 	<td class="value_input">
 | 
      
        | 160 |  |  | 		<input type="text" name="email" style="width: 380px;" maxlength="255" value="<?php print $wb->get_email(); ?>" />
 | 
      
        | 161 |  |  | 	</td>
 | 
      
        | 162 |  |  | </tr>
 | 
      
        | 163 |  |  | <tr>
 | 
      
        | 164 |  |  | 	<td> </td>
 | 
      
        | 165 |  |  | 	<td>
 | 
      
        | 166 |  |  | 		<input type="submit" name="submit" value="<?php print $TEXT['SAVE']; ?>" />
 | 
      
        | 167 |  |  | 		<input type="reset" name="reset" value="<?php print $TEXT['RESET']; ?>" />
 | 
      
        | 168 |  |  | 	</td>
 | 
      
        | 169 |  |  | </tr>
 | 
      
        | 170 |  |  | </table>
 | 
      
        | 171 |  |  | 
 | 
      
        | 172 |  |  | </form>
 | 
      
        | 173 |  |  | 
 | 
      
        | 174 |  |  | 
 | 
      
        | 175 |  |  | <h2> <?php print $HEADING['MY_PASSWORD']; ?></h2>
 | 
      
        | 176 |  |  | 
 | 
      
        | 177 |  |  | <form name="user" action="<?php print WB_URL.'/account/preferences.php'; ?>" method="post">
 | 
      
        | 178 |  |  | <input type="hidden" name="user_id" value="{USER_ID}" />
 | 
      
        | 179 |  |  | 
 | 
      
        | 180 |  |  | <table cellpadding="5" cellspacing="0" border="0" width="97%">
 | 
      
        | 181 |  |  | <tr>
 | 
      
        | 182 |  |  | 	<td width="140"><?php print $TEXT['CURRENT_PASSWORD']; ?>:</td>
 | 
      
        | 183 |  |  | 	<td>
 | 
      
        | 184 |  |  | 		<input type="password" name="current_password" style="width: 380px;" />
 | 
      
        | 185 |  |  | 	</td>
 | 
      
        | 186 |  |  | </tr>
 | 
      
        | 187 |  |  | <tr>
 | 
      
        | 188 |  |  | 	<td><?php print $TEXT['NEW_PASSWORD']; ?>:</td>
 | 
      
        | 189 |  |  | 	<td>
 | 
      
        | 190 |  |  | 		<input type="password" name="new_password" style="width: 380px;" />
 | 
      
        | 191 |  |  | 	</td>
 | 
      
        | 192 |  |  | </tr>
 | 
      
        | 193 |  |  | <tr>
 | 
      
        | 194 |  |  | 	<td><?php print $TEXT['RETYPE_NEW_PASSWORD']; ?>:</td>
 | 
      
        | 195 |  |  | 	<td>
 | 
      
        | 196 |  |  | 		<input type="password" name="new_password2" style="width: 380px;" />
 | 
      
        | 197 |  |  | 	</td>
 | 
      
        | 198 |  |  | </tr>
 | 
      
        | 199 |  |  | <tr>
 | 
      
        | 200 |  |  | 	<td> </td>
 | 
      
        | 201 |  |  | 	<td>
 | 
      
        | 202 |  |  | 		<input type="submit" name="submit" value="<?php print $TEXT['SAVE']; ?>" />
 | 
      
        | 203 |  |  | 		<input type="reset" name="reset" value="<?php print $TEXT['RESET']; ?>" />
 | 
      
        | 204 |  |  | 	</td>
 | 
      
        | 205 |  |  | </tr>
 | 
      
        | 206 |  |  | </table>
 | 
      
        | 207 |  |  | 
 | 
      
        | 208 | 239 | stefan | </form>
 |