This software is published under the same license as NucleusCMS, namely
the GNU General Public License. See for
details about the conditions of this license.
In general, this program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option) any
later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details.
class NP_LogoutRedirect extends NucleusPlugin {
   function getName() { return 'Logout Redirect'; }
   function getAuthor()  {   return 'Frank Truscott';   }
   function getURL()   { return '';   }
   function getVersion() {   return '0.1'; }
   function getDescription() {
      return 'Redirect user to member profile page after successful login';
   function getMinNucleusVersion() { return 320; }
   function supportsFeature($what)   {
      switch($what) {
      case 'SqlTablePrefix':
         return 1;
         return 0;
   function getEventList() { return array('Logout'); }
   function install() {
// Need to make some options
      $this->createOption('redirect_enabled', 'Should logout redirect be enabled?', 'yesno', 'yes');
      $this->createOption('redirect_url', 'URL to which members should be redirected upon logging out.', 'text', '');
   function event_Logout(&$data) {
        if ($this->getOption('redirect_enabled') == 'yes') {
            $url = $this->getOption('redirect_url');
            header("Location: $url");
plugins/logoutredirect/logoutredirect_code.txt · 最終更新: 2011/03/23 21:28 (外部編集)