hajime/public/3auth.php

45 lines
1.1 KiB
PHP

<?php
// Require core components
require_once __DIR__ . '/../startup.php';
// Check if the m(ode) REQUEST is set
if(isset($_REQUEST['m'])) {
switch($_REQUEST['m']) {
case 'login':
if(!isset($_REQUEST['u']) || !isset($_REQUEST['p'])) {
print '101';
break;
}
if($flashii->checkActivation($_REQUEST['u'])) {
print '102';
break;
}
if($session = $flashii->login($_REQUEST['u'], $_REQUEST['p'], true)) {
print '104|'. $session .'|'. $flashii->getUserIDFromName($_REQUEST['u']);
} else {
print '103';
}
break;
case 'check':
if(!isset($_REQUEST['u']) || !isset($_REQUEST['s'])) {
print '201';
break;
}
if($flashii->loggedIn($_REQUEST['u'], $_REQUEST['s'], true)) {
print '203';
} else {
print '202';
}
break;
}
} else {
print '000';
}