Exemplo n.º 1
0
function user_Auth()
{
    userSession_Start();
    // IP Check. If different, expire the session
    if (!isset($_SESSION['ip']) || $_SESSION['ip'] !== $_SERVER['REMOTE_ADDR']) {
        session_destroy();
    }
    userSession_End();
    // Refresh cookie lifetime
    // If session is set, lookup the node, and permissions
    if (user_AuthIsUser()) {
        // Lookup user
        //$_SESSION['node'] =
        // Extract Permissions
        // Is Admin?
    }
}
Exemplo n.º 2
0
             json_EmitFatalError_Server(null, $RESPONSE);
         }
     } else {
         json_EmitFatalError_Permission(null, $RESPONSE);
     }
     break;
     // Theme Suggestions //
 // Theme Suggestions //
 case 'idea':
     $parent_action = json_ArgShift();
     $action = json_ArgGet(0);
     switch ($action) {
         case 'getmy':
             json_ValidateHTTPMethod('GET');
             $event_id = intval(json_ArgGet(1));
             if (user_AuthIsUser()) {
                 if ($event_id) {
                     $RESPONSE['ideas'] = theme_IdeaGetMine($event_id, $AUTH['user']['id']);
                     $RESPONSE['count'] = count($RESPONSE['ideas']);
                 } else {
                     json_EmitFatalError_BadRequest(null, $RESPONSE);
                 }
             } else {
                 json_EmitFatalError_Permission(null, $RESPONSE);
             }
             break;
         case 'get':
             json_ValidateHTTPMethod('GET');
             $event_id = intval(json_ArgGet(1));
             if ($event_id !== 0) {
                 /// Broadphase: check if $event_id is on the master list of event nodes.