Show
Ignore:
Timestamp:
09/06/06 10:58:06 (5 years ago)
Author:
benoitg
Message:

* Remove most inclusions of MainUI in classes. That completely
broke authentication (circular dependencies). Fixes 245.

Unfixes 242. Exceptions should not be caught in the context

they are thrown in. Else there no point in throwing exception in the
first place.
* HyperLink?.php: Fix bug where a link with identical text as
it's link would see the text replaced by the clickthrough-tracked
equivalent.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/wifidog-auth/wifidog/classes/Node.php

    r1090 r1091  
    5050require_once('classes/Utils.php'); 
    5151require_once('classes/DateTime.php'); 
    52 require_once('classes/InterfaceElements.php'); 
    53 require_once('classes/MainUI.php'); 
    5452 
    5553/** 
     
    230228                $node_name = _("New node"); 
    231229 
    232                 try { 
    233230            if (Node::nodeExists($node_id)) { 
    234231                throw new Exception(_('This node already exists.')); 
     
    244241 
    245242            return $object; 
    246         } catch (Exception $e) { 
    247             $ui = new MainUI(); 
    248             $ui->setToolSection('ADMIN'); 
    249             $ui->displayError($e->getMessage(), false); 
    250             exit; 
    251         } 
    252243        } 
    253244 
     
    815806        public function getAdminUI() 
    816807        { 
     808            require_once('classes/InterfaceElements.php'); 
    817809            // Init values 
    818810                $html = ''; 
    819  
    820                 try { 
    821811                if (!User::getCurrentUser()) { 
    822812                        throw new Exception(_('Access denied!')); 
    823813                } 
    824         } catch (Exception $e) { 
    825             $ui = new MainUI(); 
    826             $ui->setToolSection('ADMIN'); 
    827             $ui->displayError($e->getMessage(), false); 
    828             exit; 
    829         } 
    830814 
    831815                // Get information about the network 
     
    10761060                $user = User::getCurrentUser(); 
    10771061 
    1078                 try { 
    10791062                if (!$this->isOwner($user) && !$user->isSuperAdmin()) { 
    10801063                        throw new Exception(_('Access denied!')); 
    10811064                } 
    1082         } catch (Exception $e) { 
    1083             $ui = new MainUI(); 
    1084             $ui->setToolSection('ADMIN'); 
    1085             $ui->displayError($e->getMessage(), false); 
    1086             exit; 
    1087         } 
     1065 
    10881066 
    10891067                // Check if user is a admin