Gorilla.php
changeset 3 6fe9c484bb26
parent 2 b6178b40aa09
child 4 58780df3147b
equal deleted inserted replaced
2:b6178b40aa09 3:6fe9c484bb26
   549   
   549   
   550   extract($data);
   550   extract($data);
   551   $perms = $session->fetch_page_acl($paste_id, 'Paste');
   551   $perms = $session->fetch_page_acl($paste_id, 'Paste');
   552   
   552   
   553   $localhash = false;
   553   $localhash = false;
       
   554   $hash = gorilla_sign($paste_id, $paste_text);
   554   if ( $paste_flags & PASTE_PRIVATE )
   555   if ( $paste_flags & PASTE_PRIVATE )
   555   {
   556   {
   556     $localhash = gorilla_sign($paste_id, $paste_text);
   557     $localhash = $hash;
   557   }
   558   }
   558   
   559   
   559   if ( $paste_flags & PASTE_PRIVATE || isset($_GET['delete']) )
   560   if ( $paste_flags & PASTE_PRIVATE || isset($_GET['delete']) )
   560   {
   561   {
   561     if ( @$_GET['hash'] !== $localhash )
   562     if ( @$_GET['hash'] !== $hash )
   562     {
   563     {
   563       // allow viewing regardless if mod or admin
   564       // allow viewing regardless if mod or admin
   564       if ( !($session->user_level >= USER_LEVEL_MOD && !isset($_GET['delete'])) )
   565       if ( !($session->user_level >= USER_LEVEL_MOD && !isset($_GET['delete'])) )
   565       {
   566       {
   566         die_friendly($lang->get('etc_access_denied_short'), '<p>' . $lang->get('gorilla_msg_wrong_hash') . '</p>');
   567         die_friendly($lang->get('etc_access_denied_short'), '<p>' . $lang->get('gorilla_msg_wrong_hash') . '</p>');