Changeset 747
- Timestamp:
- 10/11/2007 03:14:32 AM (3 years ago)
- Location:
- branches/1.1.6.4
- Files:
-
- 5 modified
-
actions/usersettings.php (modified) (15 diffs)
-
handlers/page/backlinks.php (modified) (2 diffs)
-
handlers/page/clone.php (modified) (8 diffs)
-
handlers/page/edit.php (modified) (6 diffs)
-
handlers/page/showcode.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/1.1.6.4/actions/usersettings.php
r392 r747 12 12 * 13 13 * @uses Wakka::htmlspecialchars_ent() 14 * 14 * 15 15 * @todo use different actions for registration / login / user settings; 16 16 * @todo add documentation links or short explanations for each option; … … 164 164 "WHERE name = '".$user['name']."' LIMIT 1"); 165 165 $this->SetUser($this->LoadUser($user["name"])); 166 166 167 167 // forward 168 168 $params .= 'stored=true'; … … 171 171 } 172 172 //user just logged in 173 else 173 else 174 174 { 175 175 // get stored settings … … 213 213 break; 214 214 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"; 216 216 break; 217 217 default: … … 245 245 </tr> 246 246 </table> 247 <?php 247 <?php 248 248 echo $this->FormClose(); //close user settings form 249 249 … … 255 255 $password_confirm = $_POST['password_confirm']; 256 256 $update_option = $this->GetSafeVar('update_option', 'post'); 257 257 258 258 switch (TRUE) 259 259 { … … 265 265 $passerror = ERROR_WRONG_PASSWORD; 266 266 $pw_selected = 'selected="selected"'; 267 $password_highlight = INPUT_ERROR_STYLE; 267 $password_highlight = INPUT_ERROR_STYLE; 268 268 break; 269 269 case (($update_option == 'hash') && $oldpass != $user['password']): //wrong hash 270 270 $passerror = ERROR_WRONG_HASH; 271 271 $hash_selected = 'selected="selected"'; 272 $password_highlight = INPUT_ERROR_STYLE; 272 $password_highlight = INPUT_ERROR_STYLE; 273 273 break; 274 274 case (strlen($password) == 0): 275 275 $passerror = ERROR_EMPTY_NEW_PASSWORD; 276 $password_highlight = INPUT_ERROR_STYLE; 276 $password_highlight = INPUT_ERROR_STYLE; 277 277 $password_new_highlight = INPUT_ERROR_STYLE; 278 278 break; 279 279 case (preg_match("/ /", $password)): 280 280 $passerror = ERROR_NO_BLANK; 281 $password_highlight = INPUT_ERROR_STYLE; 281 $password_highlight = INPUT_ERROR_STYLE; 282 282 $password_new_highlight = INPUT_ERROR_STYLE; 283 283 break; 284 284 case (strlen($password) < PASSWORD_MIN_LENGTH): 285 285 $passerror = sprintf(ERROR_PASSWORD_TOO_SHORT, PASSWORD_MIN_LENGTH); 286 $password_highlight = INPUT_ERROR_STYLE; 286 $password_highlight = INPUT_ERROR_STYLE; 287 287 $password_new_highlight = INPUT_ERROR_STYLE; 288 288 break; 289 289 case (strlen($password_confirm) == 0): 290 290 $passerror = ERROR_EMPTY_NEW_CONFIRMATION_PASSWORD; 291 $password_highlight = INPUT_ERROR_STYLE; 291 $password_highlight = INPUT_ERROR_STYLE; 292 292 $password_new_highlight = INPUT_ERROR_STYLE; 293 293 $password_confirm_highlight = INPUT_ERROR_STYLE; … … 296 296 $passerror = ERROR_PASSWORD_MATCH; 297 297 $password_highlight = INPUT_ERROR_STYLE; 298 $password_new_highlight = INPUT_ERROR_STYLE; 298 $password_new_highlight = INPUT_ERROR_STYLE; 299 299 $password_confirm_highlight = INPUT_ERROR_STYLE; 300 300 break; … … 349 349 } 350 350 // user is not logged in 351 else 351 else 352 352 { 353 353 // print confirmation message on successful logout … … 397 397 $username_highlight = INPUT_ERROR_STYLE; 398 398 break; 399 case ($this-> ExistsPage($name)):399 case ($this->existsPage($name)): // name change 400 400 $error = ERROR_RESERVED_PAGENAME; 401 401 $username_highlight = INPUT_ERROR_STYLE; … … 449 449 } 450 450 // END *** Register *** 451 } 451 } 452 452 453 453 // BEGIN *** Usersettings *** … … 455 455 { 456 456 $name = trim($_POST['yourname']); 457 if (strlen($name) == 0) // empty username 457 if (strlen($name) == 0) // empty username 458 458 { 459 459 $newerror = ERROR_EMPTY_USERNAME; 460 460 $username_temp_highlight = INPUT_ERROR_STYLE; 461 461 } 462 elseif (!$this->IsWikiName($name)) // check if name is WikiName style 462 elseif (!$this->IsWikiName($name)) // check if name is WikiName style 463 463 { 464 464 $newerror = ERROR_WIKINAME; … … 544 544 // END *** Login/Register *** 545 545 546 // BEGIN *** Login Temp Password *** 546 // BEGIN *** Login Temp Password *** 547 547 print($this->FormOpen()); 548 548 ?> … … 556 556 <td><?php echo $this->Format(RETRIEVE_PASSWORD_MESSAGE) ?></td> 557 557 </tr> 558 <?php 558 <?php 559 559 if (isset($newerror)) 560 560 { … … 577 577 <?php 578 578 print($this->FormClose()); 579 // END *** Login Temp Password *** 579 // END *** Login Temp Password *** 580 580 } 581 581 ?> -
branches/1.1.6.4/handlers/page/backlinks.php
r36 r747 5 5 * 6 6 * Usage: append /backlinks to the URL of the page 7 * 7 * 8 8 * 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. 10 10 * 11 11 * @package Handlers 12 * @subpackage 12 * @subpackage 13 13 * @name backlinks 14 14 * 15 15 * @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. 17 17 * @version 0.3 18 18 * @since Wikka 1.1.6.X 19 * 19 * 20 20 * @todo 21 * 21 * 22 22 */ 23 23 … … 30 30 if ($pages = $this->LoadPagesLinkingTo($this->tag)) { 31 31 foreach ($pages as $page) { 32 if ($this-> ExistsPage($page['tag'])) {32 if ($this->existsPage($page['tag'])) { // name change 33 33 print $this->Link($page['tag']).'<br />'; 34 34 } -
branches/1.1.6.4/handlers/page/clone.php
r120 r747 5 5 * 6 6 * 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 10 10 * page and write-access to the target page. 11 11 * If the edit option is selected, the user is redirected to the target page for … … 13 13 * 14 14 * @package Handlers 15 * @subpackage 15 * @subpackage 16 16 * @name clone 17 17 * 18 18 * @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. 20 20 * @version 0.4 21 21 * @since Wikka 1.1.6.0 22 * 22 * 23 23 * @input string $to required: the page to be created 24 24 * 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 * 27 27 * @input string $note optional: the note to be added to the page when created 28 28 * default is "Cloned from " followed by the name of the source page 29 * 29 * 30 30 * @input boolean $editoption optional: if true, the new page will be opened for edition on creation 31 31 * default is false (to allow multiple cloning of the same source) 32 32 * 33 33 * @todo Use central library for valid pagenames. 34 * 34 * 35 35 */ 36 36 // defaults … … 56 56 $to = $this->tag; 57 57 $note = sprintf(CLONED_FROM, $from); 58 $editoption = ''; 58 $editoption = ''; 59 59 $box = PLEASE_FILL_VALID_TARGET; 60 60 … … 63 63 64 64 // 1. check source page existence 65 if (!$this-> ExistsPage($from))65 if (!$this->existsPage($from)) // name change 66 66 { 67 67 // source page does not exist! 68 68 $box = sprintf(ERROR_PAGE_NOT_EXIST, $from); 69 } else 69 } else 70 70 { 71 71 // 2. page exists - now check user's read-access to the source page … … 83 83 $note = isset($_POST['note']) && $_POST['note'] ? $_POST['note'] : $note; 84 84 $editoption = (isset($_POST['editoption']))? 'checked="checked"' : ''; 85 85 86 86 // 3. check target pagename validity 87 87 if (!preg_match(VALID_PAGENAME_PATTERN, $to)) //TODO use central regex library … … 92 92 { 93 93 // 4. target page name is valid - now check user's write-access 94 if (!$this->HasAccess('write', $to)) 94 if (!$this->HasAccess('write', $to)) 95 95 { 96 96 $box = '""<em class="error">'.sprintf(ERROR_ACL_WRITE, $to).'</em>""'; … … 98 98 { 99 99 // 5. check target page existence 100 if ($this-> ExistsPage($to))101 { 100 if ($this->existsPage($to)) // name change 101 { 102 102 // page already exists! 103 103 $box = '""<em class="error">'.ERROR_PAGE_ALREADY_EXIST.'</em>""'; … … 120 120 } 121 121 } 122 } 122 } 123 123 // build form 124 124 $form = $this->FormOpen('clone'); -
branches/1.1.6.4/handlers/page/edit.php
r427 r747 17 17 * @uses Config::$gui_editor 18 18 * @uses Wakka::ClearLinkTable() 19 * @uses Wakka::ExistsPage()20 19 * @uses Wakka::Footer() 21 20 * @uses Wakka::Format() … … 40 39 * @todo use central regex library for validation; 41 40 * @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 43 42 */ 44 43 … … 189 188 // We need to escape ALL entity refs before display so we display them _as_ entities instead of interpreting them 190 189 // 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? 192 191 '<input type="hidden" name="body" value="'.$this->hsc_secure($body).'" />'."\n"; #427 193 192 … … 217 216 // append a comment? 218 217 // 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 220 219 if (isset($_REQUEST['appendcomment'])) #312, #449 221 220 { … … 228 227 // We need to escape ALL entity refs before display so we display them _as_ entities instead of interpreting them 229 228 // 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? 231 230 '<textarea id="body" name="body">'.$this->hsc_secure($body).'</textarea><br />'."\n"; #427 232 231 // add Edit note … … 241 240 $this->FormClose(); 242 241 243 if ($this->config['gui_editor'] == 1) 242 if ($this->config['gui_editor'] == 1) 244 243 { 245 244 $output .= '<script type="text/javascript" src="3rdparty/plugins/wikiedit/protoedit.js"></script>'."\n". -
branches/1.1.6.4/handlers/page/showcode.php
r120 r747 26 26 27 27 //check if page exists 28 if ($this-> ExistsPage($this->tag))28 if ($this->existsPage($this->tag)) // name change 29 29 { 30 30 //check if user has read access