Changeset 762 for trunk


Ignore:
Timestamp:
Feb 24, 2022 9:37:52 PM (2 years ago)
Author:
anonymous
Message:

Redirect if requesting login.php when already logged-in. Remove depreciated method usage.

Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/docs/examples/script_template.php

    r468 r762  
    44 * For details visit the project site: <http://trac.strangecode.com/codebase/>
    55 * Copyright 2001-2012 Strangecode, LLC
    6  * 
     6 *
    77 * This file is part of The Strangecode Codebase.
    88 *
     
    1111 * Free Software Foundation, either version 3 of the License, or (at your option)
    1212 * any later version.
    13  * 
     13 *
    1414 * The Strangecode Codebase is distributed in the hope that it will be useful, but
    1515 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    1616 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
    1717 * details.
    18  * 
     18 *
    1919 * You should have received a copy of the GNU General Public License along with
    2020 * The Strangecode Codebase. If not, see <http://www.gnu.org/licenses/>.
     
    3232
    3333$auth->requireLogin();
    34 $app->sslOn();
    3534
    3635require_once 'codebase/lib/FormValidator.inc.php';
  • trunk/lib/App.inc.php

    r752 r762  
    341341     * @access  public
    342342     * @param   string  $param      The key of the parameter to return.
     343     * @param   string  $default    The value to return if $param does not exist in $this->_params.
    343344     * @return  mixed               Parameter value, or null if not existing.
    344345     */
    345     public function getParam($param=null)
     346    public function getParam($param=null, $default=null)
    346347    {
    347348        if ($param === null) {
     
    350351            return $this->_params[$param];
    351352        } else {
    352             return null;
     353            return $default;
    353354        }
    354355    }
  • trunk/services/admins.php

    r677 r762  
    2727// require_once dirname(__FILE__) . '/_config.inc.php';
    2828
    29 $app->sslOn();
    3029$auth->requireLogin();
    3130
  • trunk/services/lock.php

    r695 r762  
    3434require_once 'codebase/lib/HTML.inc.php';
    3535
    36 $app->sslOn();
    3736$auth->requireLogin();
    3837
  • trunk/services/login.php

    r761 r762  
    3737    $app->setBoomerangURL($url, 'login');
    3838}
    39 $app->sslOn();
     39
     40if ($auth->isLoggedIn()) {
     41    if ($app->validBoomerangURL('login')) {
     42        $app->dieBoomerangURL('login');
     43    }
     44    $app->dieBoomerangURL($app->getParam('redirect_home_url', '/'));
     45}
    4046
    4147// Cookie-based storage preferences.
  • trunk/services/logs.php

    r535 r762  
    3131)));
    3232
    33 $app->sslOn();
    3433$auth->requireLogin();
    3534
  • trunk/services/password.php

    r535 r762  
    5555    $app->setBoomerangURL($_SERVER['HTTP_REFERER'], 'admin_password');
    5656}
    57 $app->sslOn();
    5857
    5958switch (getFormData('op')) {
  • trunk/services/reset_password.php

    r535 r762  
    5555}
    5656
    57 $app->sslOn();
    58 
    5957switch (getFormData('op')) {
    6058case 'reset' :
  • trunk/services/versions.php

    r695 r762  
    2727// require_once dirname(__FILE__) . '/_config.inc.php';
    2828
    29 $app->sslOn();
    3029$auth->requireLogin();
    3130
Note: See TracChangeset for help on using the changeset viewer.