roundcubemail/program/lib/Roundcube/rcube.php
public function get_secure_url_token($generate = false)
    {
        if ($len = $this->config->get('use_secure_urls')) {
            if (empty($_SESSION['secure_token']) && $generate) {
                // generate x characters long token
                $length = $len > 1 ? $len : 16;
                $token  = rcube_utils::random_bytes($length);

                $plugin = $this->plugins->exec_hook('secure_token',
                    array('value' => $token, 'length' => $length));

                $_SESSION['secure_token'] = $plugin['value'];
            }

            return $_SESSION['secure_token'];
        }

        return false;
    }
public function get_secure_url_token($generate = false)
    {
        if ($len = $this->config->get('use_secure_urls')) {
            if (empty($_SESSION['secure_token']) && $generate) {
                // generate x characters long token
                $length = $len > 1 ? $len : 16;
                $token  = rcube_utils::random_bytes($length);

                $plugin = $this->plugins->exec_hook('secure_token',
                    array('value' => $token, 'length' => $length));

                $_SESSION['secure_token'] = $plugin['value'];
            }

            return $_SESSION['secure_token'];
        }

        return false;
    }
public function get_secure_url_token ( $ generate = false ) { if ( $ len = $ this -> config -> get ( 'use_secure_urls' ) ) { if ( empty ( $ _SESSION [ 'secure_token' ] ) && $ generate ) { // generate x characters long token $ length = $ len > 1 ? $ len : 16 ; $ token = rcube_utils :: random_bytes ( $ length ) ; $ plugin = $ this -> plugins -> exec_hook ( 'secure_token' , array ( 'value' => $ token , 'length' => $ length ) ) ; $ _SESSION [ 'secure_token' ] = $ plugin [ 'value' ] ; } return $ _SESSION [ 'secure_token' ] ; } return false ; }
Returns session token for secure URLs

@param bool $generate Generate token if not exists in session yet

@return string|bool Token string, False when disabled
Returns session token for secure URLs