search for 'person-registration.txt' in e.g. /etc/planetlab/php
authorparmentelat <thierry.parmentelat@inria.fr>
Thu, 22 Mar 2018 14:34:48 +0000 (15:34 +0100)
committerparmentelat <thierry.parmentelat@inria.fr>
Thu, 22 Mar 2018 14:34:48 +0000 (15:34 +0100)
if this file exists then we use its content instead of just 'Select the site where you belong'

planetlab/persons/register.php

index 2b5ee8c..db2b44f 100644 (file)
@@ -67,9 +67,20 @@ Your <b>E-mail</b> address must be able to receive e-mail and will be
 used as your $PLC_NAME username
 EOF;
 
-$person_form['site_ids']['comment'] = <<< EOF
-Select the site where you belong
-EOF;
+
+// dirty hack feb 2018; if this file can be found,
+// its contents is used instead of the hard-wired message
+// it is searched along php's include path, so it should be
+// allright to save it as /etc/planetlab/php/person-registration.txt
+// of course html tags like <code> and <br /> are OK
+global $message_filename;
+$message_filename = "person-registration.txt";
+
+try {
+    $person_form['site_ids']['comment'] = file_get_contents($message_filename, TRUE);
+} catch (Exception $e) {
+     $person_form['site_ids']['comment'] = "Select the site where you belong";
+}
 
 if (0)
   $person_form['roles']['comment'] = <<< EOF