Selaa lähdekoodia

[svn r15092] Added faq.html and updated faq.php to fix the faq feature (see FS#2460.48)

Yannick Warnier 17 vuotta sitten
vanhempi
commit
bd0d44bb9b
2 muutettua tiedostoa jossa 14 lisäystä ja 5 poistoa
  1. 1 0
      home/faq.html
  2. 13 5
      main/help/faq.php

+ 1 - 0
home/faq.html

@@ -0,0 +1 @@
+<!-- placeholder for FAQ page, edited by main/help/faq.php -->

+ 13 - 5
main/help/faq.php

@@ -3,7 +3,7 @@
 ==============================================================================
 	Dokeos - elearning and course management software
 
-	Copyright (c) 2004-2005 Dokeos S.A.
+	Copyright (c) 2004-2008 Dokeos SPRL
 	Copyright (c) 2003-2005 Ghent University (UGent)
 	Copyright (c) 2001 Universite catholique de Louvain (UCL)
 
@@ -19,7 +19,7 @@
 
 	See the GNU General Public License for more details.
 
-	Contact address: Dokeos, 44 rue des palais, B-1030 Brussels, Belgium
+	Contact address: Dokeos, rue du Corbeau, 108, B-1030 Brussels, Belgium
 	Mail: info@dokeos.com
 ==============================================================================
 */
@@ -86,9 +86,17 @@ if(!empty($_GET['edit']) && $_GET['edit']=='true' && api_is_platform_admin())
 	if($form -> validate())
 	{
 		$content = $form -> getSubmitValue('faq_content');
-		$fp = fopen(api_get_path(SYS_PATH).'home/'.$faq_file,'w');
-		fwrite($fp, $content);
-		fclose($fp);
+		$fpath = api_get_path(SYS_PATH).'home/'.$faq_file;
+		if(is_file($fpath) && is_writeable($fpath))
+		{
+			$fp = fopen(api_get_path(SYS_PATH).'home/'.$faq_file,'w');
+			fwrite($fp, $content);
+			fclose($fp);
+		}
+		else
+		{
+			echo get_lang('WarningFaqFileNonWriteable').'<br />';
+		}
 		echo $content;
 	}
 	else