Changeset 747

Show
Ignore:
Timestamp:
10/11/2007 03:14:32 AM (21 months ago)
Author:
JavaWoman
Message:

minor update: name change ExistsPage -> existsPage (cf. [746])

refs #562

Location:
branches/1.1.6.4
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • branches/1.1.6.4/actions/usersettings.php

    r392 r747  
    1212 * 
    1313 * @uses                Wakka::htmlspecialchars_ent() 
    14  *  
     14 * 
    1515 * @todo                use different actions for registration / login / user settings; 
    1616 * @todo                add documentation links or short explanations for each option; 
     
    164164                                        "WHERE name = '".$user['name']."' LIMIT 1"); 
    165165                                $this->SetUser($this->LoadUser($user["name"])); 
    166                          
     166 
    167167                                // forward 
    168168                                $params .= 'stored=true'; 
     
    171171        } 
    172172        //user just logged in 
    173         else  
     173        else 
    174174        { 
    175175                // get stored settings 
     
    213213                        break; 
    214214                case (isset($success)): 
    215                         echo '<tr><td></td><td><em class="success">'.$this->Format($success).'</em></td></tr>'."\n";             
     215                        echo '<tr><td></td><td><em class="success">'.$this->Format($success).'</em></td></tr>'."\n"; 
    216216                        break; 
    217217                default: 
     
    245245                </tr> 
    246246        </table> 
    247 <?php    
     247<?php 
    248248        echo $this->FormClose(); //close user settings form 
    249249 
     
    255255                $password_confirm = $_POST['password_confirm']; 
    256256                $update_option = $this->GetSafeVar('update_option', 'post'); 
    257                  
     257 
    258258                switch (TRUE) 
    259259                { 
     
    265265                                $passerror = ERROR_WRONG_PASSWORD; 
    266266                                $pw_selected = 'selected="selected"'; 
    267                                 $password_highlight = INPUT_ERROR_STYLE;                         
     267                                $password_highlight = INPUT_ERROR_STYLE; 
    268268                                break; 
    269269                        case (($update_option == 'hash') && $oldpass != $user['password']): //wrong hash 
    270270                                $passerror = ERROR_WRONG_HASH; 
    271271                                $hash_selected = 'selected="selected"'; 
    272                                 $password_highlight = INPUT_ERROR_STYLE;                         
     272                                $password_highlight = INPUT_ERROR_STYLE; 
    273273                                break; 
    274274                        case (strlen($password) == 0): 
    275275                                $passerror = ERROR_EMPTY_NEW_PASSWORD; 
    276                                 $password_highlight = INPUT_ERROR_STYLE;                         
     276                                $password_highlight = INPUT_ERROR_STYLE; 
    277277                                $password_new_highlight = INPUT_ERROR_STYLE; 
    278278                                break; 
    279279                        case (preg_match("/ /", $password)): 
    280280                                $passerror = ERROR_NO_BLANK; 
    281                                 $password_highlight = INPUT_ERROR_STYLE;                         
     281                                $password_highlight = INPUT_ERROR_STYLE; 
    282282                                $password_new_highlight = INPUT_ERROR_STYLE; 
    283283                                break; 
    284284                        case (strlen($password) < PASSWORD_MIN_LENGTH): 
    285285                                $passerror = sprintf(ERROR_PASSWORD_TOO_SHORT, PASSWORD_MIN_LENGTH); 
    286                                 $password_highlight = INPUT_ERROR_STYLE;                         
     286                                $password_highlight = INPUT_ERROR_STYLE; 
    287287                                $password_new_highlight = INPUT_ERROR_STYLE; 
    288288                                break; 
    289289                        case (strlen($password_confirm) == 0): 
    290290                                $passerror = ERROR_EMPTY_NEW_CONFIRMATION_PASSWORD; 
    291                                 $password_highlight = INPUT_ERROR_STYLE;                         
     291                                $password_highlight = INPUT_ERROR_STYLE; 
    292292                                $password_new_highlight = INPUT_ERROR_STYLE; 
    293293                                $password_confirm_highlight = INPUT_ERROR_STYLE; 
     
    296296                                $passerror = ERROR_PASSWORD_MATCH; 
    297297                                $password_highlight = INPUT_ERROR_STYLE; 
    298                                 $password_new_highlight = INPUT_ERROR_STYLE;                     
     298                                $password_new_highlight = INPUT_ERROR_STYLE; 
    299299                                $password_confirm_highlight = INPUT_ERROR_STYLE; 
    300300                                break; 
     
    349349} 
    350350// user is not logged in 
    351 else  
     351else 
    352352{ 
    353353        // print confirmation message on successful logout 
     
    397397                                        $username_highlight = INPUT_ERROR_STYLE; 
    398398                                        break; 
    399                                 case ($this->ExistsPage($name)): 
     399                                case ($this->existsPage($name)):                        // name change 
    400400                                        $error = ERROR_RESERVED_PAGENAME; 
    401401                                        $username_highlight = INPUT_ERROR_STYLE; 
     
    449449                } 
    450450                // END *** Register *** 
    451         }  
     451        } 
    452452 
    453453        // BEGIN *** Usersettings *** 
     
    455455        { 
    456456                $name = trim($_POST['yourname']); 
    457                 if (strlen($name) == 0) // empty username        
     457                if (strlen($name) == 0) // empty username 
    458458                { 
    459459                        $newerror = ERROR_EMPTY_USERNAME; 
    460460                        $username_temp_highlight = INPUT_ERROR_STYLE; 
    461461                } 
    462                 elseif (!$this->IsWikiName($name)) // check if name is WikiName style    
     462                elseif (!$this->IsWikiName($name)) // check if name is WikiName style 
    463463                { 
    464464                        $newerror = ERROR_WIKINAME; 
     
    544544        // END *** Login/Register *** 
    545545 
    546         // BEGIN *** Login Temp Password ***  
     546        // BEGIN *** Login Temp Password *** 
    547547        print($this->FormOpen()); 
    548548?> 
     
    556556                <td><?php echo $this->Format(RETRIEVE_PASSWORD_MESSAGE) ?></td> 
    557557        </tr> 
    558 <?php    
     558<?php 
    559559        if (isset($newerror)) 
    560560        { 
     
    577577<?php 
    578578        print($this->FormClose()); 
    579         // END *** Login Temp Password ***  
     579        // END *** Login Temp Password *** 
    580580} 
    581581?> 
  • branches/1.1.6.4/handlers/page/backlinks.php

    r36 r747  
    55* 
    66* Usage: append /backlinks to the URL of the page 
    7 *  
     7* 
    88* This handler retrieves a list of internal pages linking to the current page. 
    9 * It first checks if they exist and prints them on the screen.  
     9* It first checks if they exist and prints them on the screen. 
    1010* 
    1111* @package Handlers 
    12 * @subpackage  
     12* @subpackage 
    1313* @name backlinks 
    1414* 
    1515* @author {@link http://wakkawiki.de/MartinBurger Martin Burger} - original idea and code. 
    16 * @author {@link http://wikkawiki.org/DarTar Dario Taraborelli} - code rewritten, ExistsPage check added, removed links array.  
     16* @author {@link http://wikkawiki.org/DarTar Dario Taraborelli} - code rewritten, existsPage check added, removed links array. 
    1717* @version 0.3 
    1818* @since Wikka 1.1.6.X 
    19 *  
     19* 
    2020* @todo 
    21 *  
     21* 
    2222*/ 
    2323 
     
    3030if ($pages = $this->LoadPagesLinkingTo($this->tag)) { 
    3131        foreach ($pages as $page) { 
    32                 if ($this->ExistsPage($page['tag'])) { 
     32                if ($this->existsPage($page['tag'])) {                  // name change 
    3333                        print $this->Link($page['tag']).'<br />'; 
    3434                } 
  • branches/1.1.6.4/handlers/page/clone.php

    r120 r747  
    55 * 
    66 * Usage: append /clone to the URL of the page you want to clone 
    7  *  
    8  * This handler checks the existence of the source page, the validity of the  
    9  * name of the target page to be created, the user's read-access to the source  
     7 * 
     8 * This handler checks the existence of the source page, the validity of the 
     9 * name of the target page to be created, the user's read-access to the source 
    1010 * page and write-access to the target page. 
    1111 * If the edit option is selected, the user is redirected to the target page for 
     
    1313 * 
    1414 * @package         Handlers 
    15  * @subpackage         
     15 * @subpackage 
    1616 * @name              clone 
    1717 * 
    1818 * @author            {@link http://wikkawiki.org/ChristianBarthelemy Christian Barthelemy} - original idea and code. 
    19  * @author            {@link http://wikkawiki.org/DarTar Dario Taraborelli} - bugs fixed, code improved, removed popup alerts.   
     19 * @author            {@link http://wikkawiki.org/DarTar Dario Taraborelli} - bugs fixed, code improved, removed popup alerts. 
    2020 * @version           0.4 
    2121 * @since             Wikka 1.1.6.0 
    22  *                       
     22 * 
    2323 * @input             string  $to  required: the page to be created 
    2424 *                            must be a non existing page and current user must be authorized to create it 
    25  *                            default is source page name                                
    26  *  
     25 *                            default is source page name 
     26 * 
    2727 * @input             string  $note  optional: the note to be added to the page when created 
    2828 *                            default is "Cloned from " followed by the name of the source page 
    29  *  
     29 * 
    3030 * @input             boolean $editoption optional: if true, the new page will be opened for edition on creation 
    3131 *                            default is false (to allow multiple cloning of the same source) 
    3232 * 
    3333 * @todo              Use central library for valid pagenames. 
    34  *         
     34 * 
    3535 */ 
    3636// defaults 
     
    5656$to = $this->tag; 
    5757$note = sprintf(CLONED_FROM, $from); 
    58 $editoption = '';  
     58$editoption = ''; 
    5959$box = PLEASE_FILL_VALID_TARGET; 
    6060 
     
    6363 
    6464// 1. check source page existence 
    65 if (!$this->ExistsPage($from)) 
     65if (!$this->existsPage($from))                                  // name change 
    6666{ 
    6767        // source page does not exist! 
    6868        $box = sprintf(ERROR_PAGE_NOT_EXIST, $from); 
    69 } else  
     69} else 
    7070{ 
    7171        // 2. page exists - now check user's read-access to the source page 
     
    8383                        $note = isset($_POST['note']) && $_POST['note'] ? $_POST['note'] : $note; 
    8484                        $editoption = (isset($_POST['editoption']))? 'checked="checked"' : ''; 
    85                  
     85 
    8686                        // 3. check target pagename validity 
    8787                        if (!preg_match(VALID_PAGENAME_PATTERN, $to))  //TODO use central regex library 
     
    9292                        { 
    9393                                // 4. target page name is valid - now check user's write-access 
    94                                 if (!$this->HasAccess('write', $to))   
     94                                if (!$this->HasAccess('write', $to)) 
    9595                                { 
    9696                                        $box = '""<em class="error">'.sprintf(ERROR_ACL_WRITE, $to).'</em>""'; 
     
    9898                                { 
    9999                                        // 5. check target page existence 
    100                                         if ($this->ExistsPage($to)) 
    101                                         {  
     100                                        if ($this->existsPage($to))                                             // name change 
     101                                        { 
    102102                                                // page already exists! 
    103103                                                $box = '""<em class="error">'.ERROR_PAGE_ALREADY_EXIST.'</em>""'; 
     
    120120                                } 
    121121                        } 
    122                 }  
     122                } 
    123123                // build form 
    124124                $form = $this->FormOpen('clone'); 
  • branches/1.1.6.4/handlers/page/edit.php

    r427 r747  
    1717 * @uses Config::$gui_editor 
    1818 * @uses Wakka::ClearLinkTable() 
    19  * @uses Wakka::ExistsPage() 
    2019 * @uses Wakka::Footer() 
    2120 * @uses Wakka::Format() 
     
    4039 * @todo                use central regex library for validation; 
    4140 * @todo        replace $_REQUEST with either $_GET or $_POST (or both if really 
    42  *                      necessary) - #312 => NOT CLEAR here what to do; see also #449   
     41 *                      necessary) - #312 => NOT CLEAR here what to do; see also #449 
    4342 */ 
    4443 
     
    189188                        // We need to escape ALL entity refs before display so we display them _as_ entities instead of interpreting them 
    190189                        // hence htmlspecialchars() instead of htmlspecialchars_ent() which UNescapes entities! 
    191                         // JW/2007-02-20: why is this? wouldn't it be  easier for the person editing to show actual characters instead of entities?   
     190                        // JW/2007-02-20: why is this? wouldn't it be  easier for the person editing to show actual characters instead of entities? 
    192191                        '<input type="hidden" name="body" value="'.$this->hsc_secure($body).'" />'."\n";        #427 
    193192 
     
    217216                // append a comment? 
    218217                // TODO not clear if this is/was intended as a URL parameter (GET), or a check box on the edito form (POST) .... 
    219                 // would be nice as a checkbox, provided it is acted upon only when user is actually submitting - NOT on preview or re-edit   
     218                // would be nice as a checkbox, provided it is acted upon only when user is actually submitting - NOT on preview or re-edit 
    220219                if (isset($_REQUEST['appendcomment'])) #312, #449 
    221220                { 
     
    228227                        // We need to escape ALL entity refs before display so we display them _as_ entities instead of interpreting them 
    229228                        // hence hsc_secure() instead of htmlspecialchars_ent() which UNescapes entities! 
    230                         // JW/2007-02-20: why is this? wouldn't it be  easier for the person editing to show actual characters instead of entities?   
     229                        // JW/2007-02-20: why is this? wouldn't it be  easier for the person editing to show actual characters instead of entities? 
    231230                        '<textarea id="body" name="body">'.$this->hsc_secure($body).'</textarea><br />'."\n";   #427 
    232231                // add Edit note 
     
    241240                        $this->FormClose(); 
    242241 
    243                 if ($this->config['gui_editor'] == 1)  
     242                if ($this->config['gui_editor'] == 1) 
    244243                { 
    245244                        $output .= '<script type="text/javascript" src="3rdparty/plugins/wikiedit/protoedit.js"></script>'."\n". 
  • branches/1.1.6.4/handlers/page/showcode.php

    r120 r747  
    2626 
    2727//check if page exists 
    28 if ($this->ExistsPage($this->tag)) 
     28if ($this->existsPage($this->tag))                              // name change 
    2929{ 
    3030        //check if user has read access