original_string: public function verify_rewaken($readonly=false) {
          global $USER, $CFG;
          if ($this->get('user')->id != $USER->id) { // make sure it belongs to the right user
              throw new portfolio_exception('notyours', 'portfolio');
          }
          if (!$readonly && $this->get('instance') && !$this->get('instance')->allows_multiple_exports()) {
              $already = portfolio_existing_exports($this->get('user')->id, $this->get('instance')->get('plugin'));
              $already = array_keys($already);
  
              if (array_shift($already) != $this->get('id')) {
  
                  $a = (object)array(
                      'plugin'  => $this->get('instance')->get('plugin'),
                      'link'    => $CFG->wwwroot . '/user/portfoliologs.php',
                  );
                  throw new portfolio_exception('nomultipleexports', 'portfolio', '', $a);
              }
          }
          if (!$this->caller->check_permissions()) { // recall the caller permission check
              throw new portfolio_caller_exception('nopermissions', 'portfolio', $this->caller->get_return_url());
          }
      }
code: public function verify_rewaken($readonly=false) {
          global $USER, $CFG;
          if ($this->get('user')->id != $USER->id) { // make sure it belongs to the right user
              throw new portfolio_exception('notyours', 'portfolio');
          }
          if (!$readonly && $this->get('instance') && !$this->get('instance')->allows_multiple_exports()) {
              $already = portfolio_existing_exports($this->get('user')->id, $this->get('instance')->get('plugin'));
              $already = array_keys($already);
  
              if (array_shift($already) != $this->get('id')) {
  
                  $a = (object)array(
                      'plugin'  => $this->get('instance')->get('plugin'),
                      'link'    => $CFG->wwwroot . '/user/portfoliologs.php',
                  );
                  throw new portfolio_exception('nomultipleexports', 'portfolio', '', $a);
              }
          }
          if (!$this->caller->check_permissions()) { // recall the caller permission check
              throw new portfolio_caller_exception('nopermissions', 'portfolio', $this->caller->get_return_url());
          }
      }
code_tokens: public function verify_rewaken ( $ readonly = false ) { global $ USER , $ CFG ; if ( $ this -> get ( 'user' ) -> id != $ USER -> id ) { // make sure it belongs to the right user throw new portfolio_exception ( 'notyours' , 'portfolio' ) ; } if ( ! $ readonly && $ this -> get ( 'instance' ) && ! $ this -> get ( 'instance' ) -> allows_multiple_exports ( ) ) { $ already = portfolio_existing_exports ( $ this -> get ( 'user' ) -> id , $ this -> get ( 'instance' ) -> get ( 'plugin' ) ) ; $ already = array_keys ( $ already ) ; if ( array_shift ( $ already ) != $ this -> get ( 'id' ) ) { $ a = ( object ) array ( 'plugin' => $ this -> get ( 'instance' ) -> get ( 'plugin' ) , 'link' => $ CFG -> wwwroot . '/user/portfoliologs.php' , ) ; throw new portfolio_exception ( 'nomultipleexports' , 'portfolio' , '' , $ a ) ; } } if ( ! $ this -> caller -> check_permissions ( ) ) { // recall the caller permission check throw new portfolio_caller_exception ( 'nopermissions' , 'portfolio' , $ this -> caller -> get_return_url ( ) ) ; } }
docstring: Verifies a rewoken object.
  Checks to make sure it belongs to the same user and session as is currently in use.
  
  @param bool $readonly if we're reawakening this for a user to just display in the log view, don't verify the sessionkey
  @throws portfolio_exception
docstring_tokens: Verifies a rewoken object . Checks to make sure it belongs to the same user and session as is currently in use .