Changeset 02a5c3


Ignore:
Timestamp:
05/14/15 13:21:47 (3 years ago)
Author:
pierre-alain <pierre-alain@…>
Branches:
master
Children:
9897b7
Parents:
f0dadb
git-author:
pierre-alain <pierre-alain@…> (05/14/15 13:21:47)
git-committer:
pierre-alain <pierre-alain@…> (05/14/15 13:21:47)
Message:

redirect user to login page when session ip is wrong instead of throwing an error (more user-friendly)

Location:
OWR
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • OWR/Controller.php

    rf0dadb r02a5c3  
    170170        catch(Exception $e) 
    171171        { 
     172            if(Exception::E_OWR_UNAUTHORIZED === $e->getCode()) 
     173                $this->redirect('login'); 
     174 
    172175            throw new Exception($e->getContent(), Exception::E_OWR_UNAVAILABLE); 
    173176        } 
  • OWR/Session.php

    r2a2406 r02a5c3  
    138138        { 
    139139            if($row['ip'] === $_SERVER['REMOTE_ADDR']) 
    140             { 
    141140                return $row['data']; 
    142             } 
    143             else 
    144             { 
    145                 throw new Exception("Invalid IP"); 
    146             } 
     141 
     142            throw new Exception("Invalid IP", Exception::E_OWR_UNAUTHORIZED); 
    147143        } 
    148144 
Note: See TracChangeset for help on using the changeset viewer.