| 
									
										
										
										
											2003-05-07 20:07:25 +00:00
										 |  |  | <?php | 
					
						
							| 
									
										
										
										
											2017-03-06 18:18:58 +00:00
										 |  |  | namespace LAM\HELP; | 
					
						
							| 
									
										
										
										
											2003-05-07 20:07:25 +00:00
										 |  |  | /* | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-27 18:47:12 +00:00
										 |  |  |   This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) | 
					
						
							| 
									
										
										
										
											2006-03-03 17:30:35 +00:00
										 |  |  |   Copyright (C) 2003 - 2006  Michael Duergner | 
					
						
							| 
									
										
										
										
											2018-03-10 17:48:11 +00:00
										 |  |  |                 2008 - 2018  Roland Gruber | 
					
						
							| 
									
										
										
										
											2003-05-07 20:07:25 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |   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. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   You should have received a copy of the GNU General Public License | 
					
						
							|  |  |  |   along with this program; if not, write to the Free Software | 
					
						
							|  |  |  |   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2003-05-12 17:36:24 +00:00
										 |  |  |   LDAP Account Manager display help pages. | 
					
						
							| 
									
										
										
										
											2003-05-07 20:07:25 +00:00
										 |  |  | */ | 
					
						
							| 
									
										
										
										
											2004-10-30 16:46:06 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | /** | 
					
						
							|  |  |  |  * LDAP Account Manager help page. | 
					
						
							| 
									
										
										
										
											2017-03-06 18:18:58 +00:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2006-05-07 09:02:52 +00:00
										 |  |  |  * @author Michael Duergner | 
					
						
							| 
									
										
										
										
											2008-02-03 18:37:05 +00:00
										 |  |  |  * @author Roland Gruber | 
					
						
							| 
									
										
										
										
											2004-10-30 16:46:06 +00:00
										 |  |  |  * @package Help | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-02-03 18:37:05 +00:00
										 |  |  | /** LDAP connection */ | 
					
						
							| 
									
										
										
										
											2003-06-07 15:00:06 +00:00
										 |  |  | include_once("../lib/ldap.inc"); | 
					
						
							| 
									
										
										
										
											2004-10-30 16:46:06 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-02-03 18:37:05 +00:00
										 |  |  | /** configuration */ | 
					
						
							| 
									
										
										
										
											2003-07-23 07:21:04 +00:00
										 |  |  | include_once("../lib/config.inc"); | 
					
						
							| 
									
										
										
										
											2003-05-07 20:07:25 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-08-20 17:40:11 +00:00
										 |  |  | /** self service functions */ | 
					
						
							|  |  |  | include_once("../lib/selfService.inc"); | 
					
						
							|  |  |  | if (!empty($_GET['selfService']) && ($_GET['selfService'] === '1')) { | 
					
						
							|  |  |  | 	session_name('SELFSERVICE'); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-07-08 18:03:28 +00:00
										 |  |  | if (strtolower(session_module_name()) == 'files') { | 
					
						
							|  |  |  | 	session_save_path("../sess"); | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2018-03-10 17:48:11 +00:00
										 |  |  | lam_start_session(); | 
					
						
							| 
									
										
										
										
											2003-05-08 20:16:32 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-02-03 18:37:05 +00:00
										 |  |  | /** status messages */ | 
					
						
							|  |  |  | include_once("../lib/status.inc"); | 
					
						
							| 
									
										
										
										
											2004-10-30 16:46:06 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-02-07 19:25:22 +00:00
										 |  |  | setlanguage(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-02-03 18:37:05 +00:00
										 |  |  | /** help data */ | 
					
						
							| 
									
										
										
										
											2003-05-12 17:36:24 +00:00
										 |  |  | include_once("../help/help.inc"); // Include help/help.inc which provides $helpArray where the help pages are stored
 | 
					
						
							| 
									
										
										
										
											2003-05-08 20:16:32 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2003-09-21 20:29:19 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-10-30 16:46:06 +00:00
										 |  |  | /** | 
					
						
							|  |  |  |  * Print HTML header of the help page. | 
					
						
							|  |  |  |  */ | 
					
						
							| 
									
										
										
										
											2009-02-07 19:25:22 +00:00
										 |  |  | function echoHTMLHead() { | 
					
						
							|  |  |  | 	echo $_SESSION['header']; | 
					
						
							| 
									
										
										
										
											2018-05-31 07:11:05 +00:00
										 |  |  | 	$title = "LDAP Account Manager Help"; | 
					
						
							|  |  |  | 	printHeaderContents($title, '..'); | 
					
						
							| 
									
										
										
										
											2009-02-07 19:25:22 +00:00
										 |  |  | 	?>
 | 
					
						
							|  |  |  | 		</head> | 
					
						
							| 
									
										
										
										
											2018-05-31 07:11:05 +00:00
										 |  |  | 		<body class="admin"> | 
					
						
							| 
									
										
										
										
											2009-02-07 19:25:22 +00:00
										 |  |  | 	<?php | 
					
						
							| 
									
										
										
										
											2018-05-31 07:11:05 +00:00
										 |  |  | 	// include all JavaScript files
 | 
					
						
							|  |  |  | 	printJsIncludes('..'); | 
					
						
							| 
									
										
										
										
											2003-05-08 20:16:32 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-10-30 16:46:06 +00:00
										 |  |  | /** | 
					
						
							|  |  |  |  * Print HTML footer of the help page. | 
					
						
							|  |  |  |  */ | 
					
						
							| 
									
										
										
										
											2009-02-07 19:25:22 +00:00
										 |  |  | function echoHTMLFoot() { | 
					
						
							|  |  |  | 	?>
 | 
					
						
							|  |  |  | 		</body> | 
					
						
							|  |  |  | 	</html> | 
					
						
							|  |  |  | 	<?php | 
					
						
							| 
									
										
										
										
											2003-05-08 20:16:32 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-10-30 16:46:06 +00:00
										 |  |  | /** | 
					
						
							|  |  |  |  * Print help site for a specific help number. | 
					
						
							| 
									
										
										
										
											2017-03-06 18:18:58 +00:00
										 |  |  |  * | 
					
						
							|  |  |  |  * @param array The help entry that is to be displayed. | 
					
						
							| 
									
										
										
										
											2004-10-30 16:46:06 +00:00
										 |  |  |  */ | 
					
						
							| 
									
										
										
										
											2015-03-08 19:34:22 +00:00
										 |  |  | function displayHelp($helpEntry) { | 
					
						
							| 
									
										
										
										
											2008-02-03 18:37:05 +00:00
										 |  |  | 	echoHTMLHead(); | 
					
						
							| 
									
										
										
										
											2018-05-31 07:11:05 +00:00
										 |  |  | 	echo "<h1 class=\"help\">" . $helpEntry['Headline'] . "</h1>\n"; | 
					
						
							|  |  |  | 	$format = "<p class=\"help\">" . $helpEntry['Text'] . "</p>\n"; | 
					
						
							| 
									
										
										
										
											2012-01-31 18:31:54 +00:00
										 |  |  | 	if (isset($helpEntry['attr'])) { | 
					
						
							|  |  |  | 		$format .= '<br><hr>' . _('Technical name') . ': <i>' . $helpEntry['attr'] . '</i>'; | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2015-03-08 19:34:22 +00:00
										 |  |  | 	echo $format; | 
					
						
							| 
									
										
										
										
											2008-02-03 18:37:05 +00:00
										 |  |  | 	if(isset($helpEntry['SeeAlso']) && is_array($helpEntry['SeeAlso'])) { | 
					
						
							| 
									
										
										
										
											2018-05-31 07:11:05 +00:00
										 |  |  | 		echo '<p class="help">' . _('See also') . ': <a class="helpSeeAlso" href="' . $helpEntry['SeeAlso']['link'] . '">' . $helpEntry['SeeAlso']['text'] . '</a></p>'; | 
					
						
							| 
									
										
										
										
											2003-05-12 17:36:24 +00:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2008-02-03 18:37:05 +00:00
										 |  |  | 	echoHTMLFoot(); | 
					
						
							| 
									
										
										
										
											2004-03-15 16:30:52 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /* If no help number was submitted print error message */ | 
					
						
							| 
									
										
										
										
											2012-03-18 18:24:25 +00:00
										 |  |  | if (!isset($_GET['HelpNumber'])) { | 
					
						
							| 
									
										
										
										
											2004-11-06 13:05:34 +00:00
										 |  |  | 	$errorMessage = "Sorry no help number submitted."; | 
					
						
							| 
									
										
										
										
											2004-03-15 16:30:52 +00:00
										 |  |  | 	echoHTMLHead(); | 
					
						
							| 
									
										
										
										
											2018-05-31 07:11:05 +00:00
										 |  |  | 	statusMessage("ERROR", "", $errorMessage); | 
					
						
							| 
									
										
										
										
											2004-03-15 16:30:52 +00:00
										 |  |  | 	echoHTMLFoot(); | 
					
						
							|  |  |  | 	exit; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | $helpEntry = array(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-09-12 15:37:23 +00:00
										 |  |  | // module help
 | 
					
						
							| 
									
										
										
										
											2009-02-07 19:25:22 +00:00
										 |  |  | if(isset($_GET['module']) && !($_GET['module'] == 'main') && !($_GET['module'] == '')) { | 
					
						
							| 
									
										
										
										
											2004-03-15 16:30:52 +00:00
										 |  |  | 	include_once("../lib/modules.inc"); | 
					
						
							| 
									
										
										
										
											2012-03-18 18:24:25 +00:00
										 |  |  | 	if (isset($_GET['scope'])) { | 
					
						
							| 
									
										
										
										
											2004-10-30 16:46:06 +00:00
										 |  |  | 		$helpEntry = getHelp($_GET['module'],$_GET['HelpNumber'],$_GET['scope']); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	else { | 
					
						
							|  |  |  | 		$helpEntry = getHelp($_GET['module'],$_GET['HelpNumber']); | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2012-03-18 18:24:25 +00:00
										 |  |  | 	if (!$helpEntry) { | 
					
						
							| 
									
										
										
										
											2018-05-31 07:11:05 +00:00
										 |  |  | 		$variables = array(htmlspecialchars($_GET['HelpNumber']), htmlspecialchars($_GET['module'])); | 
					
						
							| 
									
										
										
										
											2004-09-08 17:41:35 +00:00
										 |  |  | 		$errorMessage = _("Sorry this help id ({bold}%s{endbold}) is not available for this module ({bold}%s{endbold})."); | 
					
						
							|  |  |  | 		echoHTMLHead(); | 
					
						
							| 
									
										
										
										
											2018-05-31 07:11:05 +00:00
										 |  |  | 		statusMessage("ERROR", "", $errorMessage, $variables); | 
					
						
							| 
									
										
										
										
											2004-09-08 17:41:35 +00:00
										 |  |  | 		echoHTMLFoot(); | 
					
						
							|  |  |  | 		exit; | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2004-03-15 16:30:52 +00:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2005-09-12 15:37:23 +00:00
										 |  |  | // help entry in help.inc
 | 
					
						
							| 
									
										
										
										
											2004-03-15 16:30:52 +00:00
										 |  |  | else { | 
					
						
							|  |  |  | 	/* If submitted help number is not in help/help.inc print error message */ | 
					
						
							| 
									
										
										
										
											2012-03-18 18:24:25 +00:00
										 |  |  | 	if (!array_key_exists($_GET['HelpNumber'],$helpArray)) { | 
					
						
							| 
									
										
										
										
											2018-05-31 07:11:05 +00:00
										 |  |  | 		$variables = array(htmlspecialchars($_GET['HelpNumber'])); | 
					
						
							| 
									
										
										
										
											2012-03-18 18:24:25 +00:00
										 |  |  | 		$errorMessage = _("Sorry this help number ({bold}%s{endbold}) is not available."); | 
					
						
							| 
									
										
										
										
											2003-05-12 17:36:24 +00:00
										 |  |  | 		echoHTMLHead(); | 
					
						
							| 
									
										
										
										
											2018-05-31 07:11:05 +00:00
										 |  |  | 		statusMessage("ERROR", "", $errorMessage, $variables); | 
					
						
							| 
									
										
										
										
											2003-05-08 20:16:32 +00:00
										 |  |  | 		echoHTMLFoot(); | 
					
						
							| 
									
										
										
										
											2004-03-15 16:30:52 +00:00
										 |  |  | 		exit; | 
					
						
							| 
									
										
										
										
											2003-05-08 20:16:32 +00:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2004-03-15 16:30:52 +00:00
										 |  |  | 	else { | 
					
						
							|  |  |  | 		$helpEntry = $helpArray[$_GET['HelpNumber']]; | 
					
						
							| 
									
										
										
										
											2003-05-08 20:16:32 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-03-08 19:34:22 +00:00
										 |  |  | displayHelp($helpEntry); | 
					
						
							| 
									
										
										
										
											2003-05-08 20:16:32 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-06 18:35:33 +00:00
										 |  |  | ?>
 |