WeakWiki


modules\ussm\ussm.module.php

WeakWiki (WeakWiki User Self Service (ussm) module: ussm.module.php) Copyright (C) 2010 Alexander Lang 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 3 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. You should have received a copy of the GNU General Public License along with this program; if not, see . Project Home: http://weakwiki.robnet.wmweb.at/ Contact: robbiblubber@robnet.wmweb.at



/********************************************************************************
WeakWiki (WeakWiki User Self Service (ussm) module: ussm.module.php)
Copyright (C) 2010 Alexander Lang

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 3 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.

You should have received a copy of the GNU General Public License along with this
program; if not, see .

Project Home: http://weakwiki.robnet.wmweb.at/
Contact:      robbiblubber@robnet.wmweb.at
********************************************************************************/



require_once('./lib/modules.library.php');


require_once(_lang('ussm.module'));


define('USSM_REGISTER_USERS', true);
define('USSM_PASSWORD_RESET', true);

define('USSM_MENU_REGISTER', true);

define('USSM_ALLOW_WRITE', true);
define('USSM_VERIFY_EMAIL', true);

define('USSM_EMAIL_TITLE', 'Activate your WeakWiki account');
define('USSM_EMAIL_BODY',  "Hi %NAME%!\nPlease follow the link below to activate your WeakWiki account!\n\n");
define('USSM_EMAIL_SIGNATURE',  "\n\nRegards, WeakWiki.\n\n\nThis e-Mail has been auto-generated by the WeakWiki User Self Service (ussm) Module.\n");
define('USSM_EMAIL_ADDHEADERS', 'From: WeakWiki registration ');

define('USSM_PASSWD_EMAIL_TITLE', 'WeakWiki password has been reset');
define('USSM_PASSWD_EMAIL_BODY',  "Hi %NAME%!\nYou have chosen to reset your WeakWiki password. Your new password is: %PASSWD%.\n\n");



/** This is class implements the user self service (ussm) module.				*/
class UserSelfServiceModule extends __Module
{
	/** Returns the module name.
		@return		Module name.												*/
	public function getName()
	{
		return "ussm";
	}
	
	/** Returns the module version.
		@return		Module name.												*/
	public function getVersion()
	{
		return _VERSION;
	}
	
	/** Returns a description of the module.
		@return		Module description.											*/
	public function getDescription()
	{
		return "User Self Service Module";
	}
	
	/** Returns the module's parse mode.
		@return		Parse mode.													*/
	public function getParseMode()
	{
		return MOD_MODE_PARSE_LINKS;
	}
	
	/** Returns a detail page for the module.
		@return		Module detail page.											*/
	public function getDetails()
	{
		return "ussm
WeakWiki User Self Servic Module Version" . $this->getVersion() . "
by Alexander Lang
Copyright (C) 2010 Alexander Lang"; } /** Returns links to add to main menu. @return Main menu links. */ public function addToMainMenu() { if(USSM_REGISTER_USERS && USSM_MENU_REGISTER && (currentUser() == null)) { return "" . _L_USSM_0000 . " | "; } return ""; } /** Method is called when parsing links. @param $input Unparsed text. @return Parsed text. */ public function parseLink($input) { switch($input) { case "@m:ussm/register": return _WIKI_COMMAND . "?action=ussm&page=register"; case "@m:ussm/reset": case "@m:ussm/resetpassword": return _WIKI_COMMAND . "?action=ussm&page=resetpassword"; case "@m:ussm/details": return _WIKI_COMMAND . "?action=ussm&page=details"; } return $input; } /** Adequately reacts to a module query. @return TRUE when module processes the query, otherwise FALSE. */ public function run() { if(isset($_GET['action'])) { if($_GET['action'] == "ussm") { include('./modules/ussm/ussm.include.php'); return true; } } return false; } } ?>

WeakWiki