| 
									
										
										
										
											2017-11-24 00:09:36 +01:00
										 |  |  | <?php | 
					
						
							|  |  |  | $id = $_SESSION['user']; | 
					
						
							|  |  |  | if (isset($_GET['id'])) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	$id = $_GET['id']; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | try { | 
					
						
							|  |  |  | 	$displayed_user = new User($id); | 
					
						
							|  |  |  | } catch (Exception $e) { | 
					
						
							| 
									
										
										
										
											2018-01-12 21:35:31 +01:00
										 |  |  | 	header("Location: ".WEB_URL."/admin/?do=user"); | 
					
						
							| 
									
										
										
										
											2017-11-24 00:09:36 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | if (isset($_POST['password'])) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	$displayed_user->change_password(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | if (isset($_POST['email'])) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	$displayed_user->email_link(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | if (isset($_POST['permission'])) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	$displayed_user->change_permission(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-03 14:15:45 +01:00
										 |  |  | if (isset($_GET['what']) && $_GET['what']=='toggle') | 
					
						
							| 
									
										
										
										
											2017-11-24 00:09:36 +01:00
										 |  |  | { | 
					
						
							|  |  |  | 	$displayed_user->toggle(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-07 20:39:10 +01:00
										 |  |  | Template::render_header(_("User"), true); | 
					
						
							| 
									
										
										
										
											2017-11-24 00:09:36 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | ?>
 | 
					
						
							|  |  |  | <div class="text-center"> | 
					
						
							| 
									
										
										
										
											2017-12-31 00:41:58 +01:00
										 |  |  |   	<h1><?php echo _("User settings");?></h1>
 | 
					
						
							| 
									
										
										
										
											2017-11-24 00:09:36 +01:00
										 |  |  | </div> | 
					
						
							|  |  |  | <?php if (isset($message)){?>
 | 
					
						
							|  |  |  |     <p class="alert alert-danger"><?php echo $message?></p>
 | 
					
						
							|  |  |  | <?php } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | $displayed_user->render_user_settings(); |