Changeset 947
- Timestamp:
- 11/15/08 17:19:39 (4 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
tests/textblock.php (modified) (1 diff)
-
www/controllers/textblock.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/textblock.php
r934 r947 261 261 log_assert_equal($res['redirect_count'], 0); 262 262 263 log_print("Testing security for restore"); 264 $res = curl_test(array( 265 'url' => url_textblock_edit('sandbox/test_page_revision'), 266 'user' => 'test_admin', 267 'post' => array( 268 'text' => "ugu 1\n", 269 'title' => "Test ugu 1", 270 'security' => "private", 271 'last_revision' => "0", 272 ))); 273 usleep(1000000); 274 $res = curl_test(array( 275 'url' => url_textblock_edit('sandbox/test_page_revision'), 276 'user' => 'test_admin', 277 'post' => array( 278 'text' => "ugu 2\n", 279 'title' => "Test ugu 2", 280 'security' => "protected", 281 'last_revision' => "1", 282 ))); 283 usleep(1000000); 284 $res = curl_test(array( 285 'url' => url_textblock_edit('sandbox/test_page_revision'), 286 'user' => 'test_admin', 287 'post' => array( 288 'text' => "ugu 3\n", 289 'title' => "Test ugu 3", 290 'security' => "public", 291 'last_revision' => "2", 292 ))); 293 usleep(1000000); 294 $res = curl_test(array( 295 'url' => url_textblock_restore('sandbox/test_page_revision', 1), 296 'user' => 'test_dude1', 297 'post' => array() 298 )); 299 log_assert_equal($res['url'], url_absolute(url_home())); 300 log_assert(!strstr($res['content'], 'Nu ai permisiuni')); 301 $res = curl_test(array( 302 'url' => url_textblock_restore('sandbox/test_page_revision', 2), 303 'user' => 'test_dude1', 304 'post' => array() 305 )); 306 log_assert_equal($res['url'], url_absolute(url_home())); 307 log_assert(!strstr($res['content'], 'Nu ai permisiuni')); 263 308 log_print("Textblock tests all passed"); 264 309 test_cleanup(); -
trunk/www/controllers/textblock.php
r945 r947 117 117 $rev = textblock_get_revision($page_name, $rev_num); 118 118 119 if ($page ) {119 if ($page and $rev) { 120 120 identity_require('textblock-restore', $page); 121 identity_require('textblock-restore', $rev); 121 122 } else { 122 123 flash_error("Pagina nu exista");
Note: See TracChangeset
for help on using the changeset viewer.
![[infoarena] development](/chrome/site/logo.png)