Restructuring repo
This commit is contained in:
		
							parent
							
								
									1a8e913f28
								
							
						
					
					
						commit
						436fd4d2cd
					
				
					 85 changed files with 8 additions and 2 deletions
				
			
		
							
								
								
									
										16
									
								
								login.php
									
										
									
									
									
								
							
							
						
						
									
										16
									
								
								login.php
									
										
									
									
									
								
							|  | @ -1,16 +0,0 @@ | |||
| <?php | ||||
| if (empty($_POST) || !isset($_POST['submit'])) { | ||||
| 	die("Login canceled: no post / no submit"); | ||||
| } | ||||
| 
 | ||||
| require_once('inc/database.php'); | ||||
| $db = new DataBase(); | ||||
| $user = $db->getUserByHandle($_POST['name']); | ||||
| if ($db->passwordVerify($user['user.id'], $_POST['pass'])) { | ||||
| 	$token = $db->tokenAdd($user['user.id']); | ||||
| 	$token64 = base64_encode($token); | ||||
| 	$expires = time() + 2592000; // 30 days
 | ||||
| 	setcookie('token', $token64, $expires); | ||||
| } | ||||
| header("Location: /"); | ||||
| ?>
 | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue