Changeset 609

Show
Ignore:
Timestamp:
05/01/05 21:22:02 (8 years ago)
Author:
fproulx
Message:

2005-04-30 Francois Proulx <francois.proulx@…>

  • Logout button will now destroy session AND render token USED
Location:
trunk/wifidog-auth
Files:
8 modified

Legend:

Unmodified
Added
Removed
  • trunk/wifidog-auth/ChangeLog

    r608 r609  
     12005-04-30 Francois Proulx <francois.proulx@gmail.com> 
     2        * Logout button will now destroy session AND render token USED 
     3         
    142005-04-30 Francois Proulx <francois.proulx@gmail.com> 
    25        * Fixed bug that could potentially let non owners add content in /content through content groups 
  • trunk/wifidog-auth/wifidog/admin/content_admin.php

    r591 r609  
    4646if ($_REQUEST['action'] == 'list_all_content' || $_REQUEST['action'] == 'list_persistent_content') 
    4747{ 
    48     $html .= '<form action="'.CONTENT_ADMIN_ABS_HREF.'" method="get">'; 
    49      
    50     if($_REQUEST['action'] == 'list_persistent_content') 
    51     { 
    52         $sql = "SELECT * FROM content WHERE is_persistent = true ORDER BY content_type"; 
    53         $html .= "<input type='hidden' name='action' value='list_all_content'>\n"; 
    54         $html .= "<input type=submit name='list_submit' value='"._("Show all content")."'>\n"; 
    55     } 
    56     else 
    57     { 
    58         $sql = "SELECT * FROM content ORDER BY content_type"; 
    59         $html .= "<input type='hidden' name='action' value='list_persistent_content'>\n"; 
    60         $html .= "<input type=submit name='list_submit' value='"._("Show only persistent content")."'>\n"; 
    61     }    
     48        $html .= '<form action="'.CONTENT_ADMIN_ABS_HREF.'" method="get">'; 
     49 
     50        if ($_REQUEST['action'] == 'list_persistent_content') 
     51        { 
     52                $sql = "SELECT * FROM content WHERE is_persistent = true ORDER BY content_type"; 
     53                $html .= "<input type='hidden' name='action' value='list_all_content'>\n"; 
     54                $html .= "<input type=submit name='list_submit' value='"._("Show all content")."'>\n"; 
     55        } 
     56        else 
     57        { 
     58                $sql = "SELECT * FROM content ORDER BY content_type"; 
     59                $html .= "<input type='hidden' name='action' value='list_persistent_content'>\n"; 
     60                $html .= "<input type=submit name='list_submit' value='"._("Show only persistent content")."'>\n"; 
     61        } 
    6262        $db->ExecSql($sql, $results, false); 
    63      
    64     $html .= '</form>'; 
    65      
     63 
     64        $html .= '</form>'; 
     65 
    6666        if ($results != null) 
    6767        { 
    6868                $html .= "<table>\n"; 
    6969                $html .= "<tr><th>"._("Title")."</th><th>"._("Content type")."</th><th>"._("Description")."</th></tr>\n"; 
    70          
    71         // Get the current user 
    72         $user = User :: getCurrentUser(); 
    73          
    74                 foreach ($results as $row) 
     70 
     71                // Get the current user 
     72                $user = User :: getCurrentUser(); 
     73 
     74                if ($user) 
    7575                { 
    76                         $content = Content :: getObject($row['content_id']); 
    77             if ($user->isSuperAdmin() || $content->isOwner(User :: getCurrentUser())) 
    78             { 
    79                         if (!empty ($row['title'])) 
    80                         { 
    81                                 $title = Content :: getObject($row['title']); 
    82                                 $title_ui = $title->__toString(); 
    83                         } 
    84                         else 
    85                         { 
    86                                 $title_ui = null; 
    87                         } 
    88      
    89                         if (!empty ($row['description'])) 
    90                         { 
    91                                 $description = Content :: getObject($row['description']); 
    92                                 $description_ui = $description->__toString(); 
    93                         } 
    94                         else 
    95                         { 
    96                                 $description_ui = null; 
    97                         } 
    98                         $href = GENERIC_OBJECT_ADMIN_ABS_HREF."?object_id=$row[content_id]&object_class=Content&action=edit"; 
    99                         $html .= "<tr><td>$title_ui</td><td><a href='$href'>$row[content_type]</a></td><td>$description_ui</td>\n"; 
    100                         $href = GENERIC_OBJECT_ADMIN_ABS_HREF."?object_id=$row[content_id]&object_class=Content&action=delete"; 
    101                         $html .= "<td><a href='$href'>Delete</a></td>"; 
    102      
    103                         $html .= "</tr>\n"; 
    104             } 
     76                        foreach ($results as $row) 
     77                        { 
     78                                $content = Content :: getObject($row['content_id']); 
     79                                if ($user->isSuperAdmin() || $content->isOwner(User :: getCurrentUser())) 
     80                                { 
     81                                        if (!empty ($row['title'])) 
     82                                        { 
     83                                                $title = Content :: getObject($row['title']); 
     84                                                $title_ui = $title->__toString(); 
     85                                        } 
     86                                        else 
     87                                        { 
     88                                                $title_ui = null; 
     89                                        } 
     90 
     91                                        if (!empty ($row['description'])) 
     92                                        { 
     93                                                $description = Content :: getObject($row['description']); 
     94                                                $description_ui = $description->__toString(); 
     95                                        } 
     96                                        else 
     97                                        { 
     98                                                $description_ui = null; 
     99                                        } 
     100                                        $href = GENERIC_OBJECT_ADMIN_ABS_HREF."?object_id=$row[content_id]&object_class=Content&action=edit"; 
     101                                        $html .= "<tr><td>$title_ui</td><td><a href='$href'>$row[content_type]</a></td><td>$description_ui</td>\n"; 
     102                                        $href = GENERIC_OBJECT_ADMIN_ABS_HREF."?object_id=$row[content_id]&object_class=Content&action=delete"; 
     103                                        $html .= "<td><a href='$href'>Delete</a></td>"; 
     104 
     105                                        $html .= "</tr>\n"; 
     106                                } 
     107                        } 
    105108                } 
    106109                $html .= "</table>\n"; 
  • trunk/wifidog-auth/wifidog/admin/owner_sendfiles.php

    r568 r609  
    2323   * @author Copyright (C) 2005 Pascal Leclerc 
    2424   */ 
     25//TODO: Move to Node getAdminUI 
    2526 
    26 /* 
    27   Notes/TODO : 
    28     Valider les donnees passees en arguments 
    29     Utiliser smarty 
    30     Permettre la recherche de user directement dans l'interface owner 
    31     156.486 / 5120.0 MB Used 
    32          
    33 */ 
    3427 
    3528define('BASEPATH','../'); 
  • trunk/wifidog-auth/wifidog/classes/Authenticator.php

    r530 r609  
    8282                // Stop traffic counters update 
    8383                global $db; 
    84                 $db->ExecSqlUpdate("UPDATE connections SET "."timestamp_out=NOW(),"."token_status='".TOKEN_USED."' "."WHERE conn_id='{$info['conn_id']}';\n"); 
     84                $db->ExecSqlUpdate("UPDATE connections SET "."timestamp_out=NOW(),"."token_status='".TOKEN_USED."' "."WHERE conn_id='{$info['conn_id']}';\n", false); 
    8585        } 
    8686         
  • trunk/wifidog-auth/wifidog/classes/MainUI.php

    r608 r609  
    5757                        $html .= "<ul class='admin_menu_list'>\n"; 
    5858             
    59             if($current_user->isSuperAdmin()) 
     59            if($current_user && $current_user->isSuperAdmin()) 
    6060            { 
    6161                        $html .= "<li><a href='user_log.php'>"._("User logs")."</a></li>\n"; 
     
    6969 
    7070                        // If the user is super admin OR owner of at least one hotspot show the menu 
    71                         if($current_user->isSuperAdmin() || $current_user->isOwner()) 
     71                        if($current_user && ($current_user->isSuperAdmin() || $current_user->isOwner())) 
    7272                        { 
    7373                                /* Node admin */ 
     
    9797 
    9898                        /* Network admin */ 
    99             if($current_user->isSuperAdmin()) 
     99            if($current_user && $current_user->isSuperAdmin()) 
    100100            { 
    101101                        $html .= "<div class='admin_section_container'>\n"; 
  • trunk/wifidog-auth/wifidog/classes/User.php

    r608 r609  
    5454                try 
    5555                { 
    56                         $user = new User($session->get(SESS_USER_ID_VAR)); 
     56                        $user = self :: getObject($session->get(SESS_USER_ID_VAR)); 
     57                        //$user = new User($session->get(SESS_USER_ID_VAR)); 
    5758                } 
    5859                catch (Exception $e) 
     
    374375 
    375376        } 
    376          
     377 
    377378        function getValidationToken() 
    378379        { 
     
    460461                global $session; 
    461462                $session->destroy(); 
    462                 //TODO: Completed this part with Network::getObject() 
    463                 /* 
    464                 try { 
    465                     $connections = $this->getConnections(); 
    466                     foreach($connections as $connection) 
    467                         if($connection['token_status'] == TOKEN_UNUSED || $connection['token_status'] == TOKEN_INUSE) 
    468                             Network::getCurrentNetwork()->getAuthenticator()->logout(array('conn_id' => $connection['conn_id']), $errmsg); 
    469                 } catch(Exception $e) 
    470                 { 
    471                     //TODO: Error management ( MainUI ) 
    472                 }*/ 
     463                try 
     464                { 
     465                        $connections = $this->getConnections(); 
     466                        if ($connections) 
     467                                foreach ($connections as $connection) 
     468                                        if ($connection['token_status'] == TOKEN_UNUSED || $connection['token_status'] == TOKEN_INUSE) 
     469                                                Network :: getCurrentNetwork()->getAuthenticator()->logout(array ('conn_id' => $connection['conn_id']), $errmsg); 
     470                } 
     471                catch (Exception $e) 
     472                { 
     473                } 
    473474        } 
    474475 
  • trunk/wifidog-auth/wifidog/config.php

    r592 r609  
    77 * 
    88 *     $Log$ 
     9 *     Revision 1.42  2005/05/02 01:22:02  fproulx 
     10 *     2005-04-30 Francois Proulx <francois.proulx@gmail.com> 
     11 *      * Logout button will now destroy session AND render token USED 
     12 * 
    913 *     Revision 1.41  2005/04/28 03:14:48  fproulx 
    1014 *     *** empty log message *** 
     
    4549 *      * Fixed bugs in File 
    4650 *      * Wrote part of EmbeddedContent ( partially working ) 
    47  *      * TODO: add support for parameters and attributes in EmbeddedContent 
     51 *      * add support for parameters and attributes in EmbeddedContent 
    4852 * 
    4953 *     Revision 1.34  2005/04/21 14:58:29  fproulx 
  • trunk/wifidog-auth/wifidog/local_content/default/stylesheet.css

    r607 r609  
    325325.flickr_title { 
    326326        color: white; 
    327     visibility: hidden; 
    328327    width: 200px; 
    329328    background: #696969; 
     
    371370} 
    372371.flickr_description { 
    373     visibility: hidden; 
    374372    width: 180px; 
    375373    background: #696969;