From f0a950530aa6a870952849d7d19090b28fff3254 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Thu, 6 Mar 2008 16:22:27 +0000 Subject: [PATCH] ebl Add javascript verification code --- docs/home-page/en/pages/testimonial.php | 281 ++++++++++++++++-------- 1 file changed, 195 insertions(+), 86 deletions(-) diff --git a/docs/home-page/en/pages/testimonial.php b/docs/home-page/en/pages/testimonial.php index eaa9c410..d81420bf 100644 --- a/docs/home-page/en/pages/testimonial.php +++ b/docs/home-page/en/pages/testimonial.php @@ -3,7 +3,7 @@ $dat_dir = '/tmp/testimonials'; $org_type_lst = array( - '0' => "SELECT ONE", + 'empty' => "SELECT ONE", '15' => "Church / Religious Organization", '3' => "Corporation", '14' => "Educational Institution", @@ -15,7 +15,7 @@ $org_type_lst = array( ); $version_lst = array( - '0' => "SELECT ONE", + 'empty' => "SELECT ONE", '1' => "1.36.x", '2' => "1.38.x", '3' => "2.0.x", @@ -24,57 +24,57 @@ $version_lst = array( ); $catalog_lst = array( - '0' => "SELECT ONE", + 'empty' => "SELECT ONE", '1' => "MySQL", '2' => "PostgreSQL", '3' => "SqLite" ); $org_industry_lst = array( - '0' => 'SELECT ONE', '25' => 'Aerospace / Aeronautical', - '11' => 'Agriculture / Farming', '38' => 'Architecture / Design', - '44' => 'Arts', '5' => 'ASP', - '54' => 'Banking', - '42' => 'Church / Religious Organization', '45' => 'Coaching', - '10' => 'Construction', '22' => 'Consulting (General)', - '21' => 'Consulting (Information Technology)', '31' => 'Defense Industry', - '51' => 'Education / Training', '37' => 'Energy Industry', - '46' => 'Engineering', '35' => 'Entertainment (Film)', - '34' => 'Entertainment (Music)', '36' => 'Entertainment (Other)', - '47' => 'Event Management / Conferences', '7' => 'Finance / Banking / Accounting', - '12' => 'Food Service Industry', '29' => 'Government', - '3' => 'Healthcare / Medicine', '8' => 'Higher Education', - '6' => 'Insurance', '4' => 'Internet Service Provider', - '2' => 'K-12 Education', '48' => 'Law Enforcement / Emergency Management', - '14' => 'Legal', '24' => 'Manufacturing (Computer Equipment)', - '23' => 'Manufacturing (General)', '53' => 'Media (Publishing, Broadcasting, etc)', - '30' => 'Military', '9' => 'Mining', - '18' => 'Natural Resources / Environment', '15' => 'Pharmaceuticals', - '49' => 'Public Relations / Advertising', '13' => 'Real Estate', - '41' => 'Retail / Consumer Goods', '52' => 'Sales / Marketing', - '32' => 'Scientific Research', '33' => 'Sports / Recreation', - '43' => 'Technical College / Trade School', '40' => 'Telecommunications', - '27' => 'Transportation Industry (Air)', '28' => 'Transportation Industry (General)', - '26' => 'Transportation Industry (Marine)', '50' => 'Travel / Tourism / Lodging', - '17' => 'Travel Industry', '39' => 'Utilities / Public Works', - '16' => 'Other' + 'empty' => 'SELECT ONE', '25' => 'Aerospace / Aeronautical', + '11' => 'Agriculture / Farming', '38' => 'Architecture / Design', + '44' => 'Arts', '5' => 'ASP', + '54' => 'Banking', + '42' => 'Church / Religious Organization', '45' => 'Coaching', + '10' => 'Construction', '22' => 'Consulting (General)', + '21' => 'Consulting (Information Technology)', '31' => 'Defense Industry', + '51' => 'Education / Training', '37' => 'Energy Industry', + '46' => 'Engineering', '35' => 'Entertainment (Film)', + '34' => 'Entertainment (Music)', '36' => 'Entertainment (Other)', + '47' => 'Event Management / Conferences', '7' => 'Finance / Banking / Accounting', + '12' => 'Food Service Industry', '29' => 'Government', + '3' => 'Healthcare / Medicine', '8' => 'Higher Education', + '6' => 'Insurance', '4' => 'Internet Service Provider', + '2' => 'K-12 Education', '48' => 'Law Enforcement / Emergency Management', + '14' => 'Legal', '24' => 'Manufacturing (Computer Equipment)', + '23' => 'Manufacturing (General)', '53' => 'Media (Publishing, Broadcasting, etc)', + '30' => 'Military', '9' => 'Mining', + '18' => 'Natural Resources / Environment', '15' => 'Pharmaceuticals', + '49' => 'Public Relations / Advertising', '13' => 'Real Estate', + '41' => 'Retail / Consumer Goods', '52' => 'Sales / Marketing', + '32' => 'Scientific Research', '33' => 'Sports / Recreation', + '43' => 'Technical College / Trade School', '40' => 'Telecommunications', + '27' => 'Transportation Industry (Air)', '28' => 'Transportation Industry (General)', + '26' => 'Transportation Industry (Marine)', '50' => 'Travel / Tourism / Lodging', + '17' => 'Travel Industry', '39' => 'Utilities / Public Works', + '16' => 'Other' ); $os_lst = array( - '0' => 'SELECT ONE', '20' => 'AIX', - '21' => 'FreeBSD', '14' => 'HP-UX', - '2' => 'Linux (Debian)', '27' => 'Linux (Fedora)', - '25' => 'Linux (Gentoo)', '4' => 'Linux (Mandrake)', - '5' => 'Linux (Other)', '1' => 'Linux (RedHat)', - '26' => 'Linux (Slackware)', '3' => 'Linux (Suse)', - '18' => 'Mac OS X', '22' => 'NetBSD', - '23' => 'OpenBSD', '24' => 'Other', - '13' => 'Solaris', '15' => 'Windows 2000', - '16' => 'Windows 2003', '17' => 'Windows XP' + 'empty' => 'SELECT ONE', '20' => 'AIX', + '21' => 'FreeBSD', '14' => 'HP-UX', + '2' => 'Linux (Debian)', '27' => 'Linux (Fedora)', + '25' => 'Linux (Gentoo)', '4' => 'Linux (Mandrake)', + '5' => 'Linux (Other)', '1' => 'Linux (RedHat)', + '26' => 'Linux (Slackware)', '3' => 'Linux (Suse)', + '18' => 'Mac OS X', '22' => 'NetBSD', + '23' => 'OpenBSD', '24' => 'Other', + '13' => 'Solaris', '15' => 'Windows 2000', + '16' => 'Windows 2003', '17' => 'Windows XP' ); $country_lst = array( - '0' => 'SELECT ONE', '1' => 'Afghanistan', + 'empty' => 'SELECT ONE', '1' => 'Afghanistan', '2' => 'Albania', '3' => 'Algeria', '4' => 'American Samoa', '5' => 'Andorra', '6' => 'Angola', '7' => 'Anguilla', @@ -193,14 +193,122 @@ $country_lst = array( '229' => 'Zambia', '230' => 'Zimbabwe' ); -if ($_REQUEST['btnSubmit'] == 'Add' or $_REQUEST['btnSubmit'] == 'Modify') +if ($_REQUEST['action'] == 'Add' or $_REQUEST['action'] == 'Modify') { ?> + + @@ -222,7 +330,7 @@ information about how this data will be used.
- Testimonial + Testimonial
-
+ @@ -383,6 +491,12 @@ while(list ($key, $val) = each ($catalog_lst)) + + + +
*Number of Director (Running bacula-dir): +
*Number of Clients (Running bacula-fd): "; - echo ""; - echo "
"; + echo ""; + echo "
"; echo "
"; } else { - echo ""; + echo ""; } ?> @@ -468,14 +582,9 @@ we find the need.
- \n"; -} elseif ($_REQUEST['btnSubmit'] == 'Review Profile Submission') { +} elseif ($_REQUEST['action'] == 'Review Profile Submission') { $form = get_formul(); if (!$form) { @@ -515,11 +624,11 @@ if ($_REQUEST['btnSubmit'] == 'Modify') { save_formul($form); send_email($form['id'], $form['email_address']); - echo "You can modify your profile here (keep this link as bookmark)

"; + echo "You can modify your profile here (keep this link as bookmark)

"; print_formul($form); } -} elseif ($_REQUEST['btnSubmit'] == 'View') { +} elseif ($_REQUEST['action'] == 'View') { $file = get_file_from_id(); @@ -527,7 +636,7 @@ if ($_REQUEST['btnSubmit'] == 'Modify') { print_formul_file($filename,true); } -} elseif ($_REQUEST['btnSubmit'] == 'Delete') { +} elseif ($_REQUEST['action'] == 'Delete') { $filename = get_file_from_id(); @@ -545,7 +654,7 @@ if ($_REQUEST['btnSubmit'] == 'Modify') { echo "Profile deleted"; } -} elseif ($_REQUEST['btnSubmit'] == 'Accept' && is_admin()) { +} elseif ($_REQUEST['action'] == 'Accept' && is_admin()) { $filename = get_file_from_id(); @@ -566,7 +675,7 @@ if ($_REQUEST['btnSubmit'] == 'Modify') { echo $form['id'] . " is now " . ($hide?"un":"") . "visible"; print_formul($form); -} elseif ($_REQUEST['btnSubmit'] == 'Save') { +} elseif ($_REQUEST['action'] == 'Save') { $filename = get_file_from_id(); @@ -590,43 +699,43 @@ if ($_REQUEST['btnSubmit'] == 'Modify') { echo "Your profile has been modified.
"; print_formul($form); -} elseif ($_REQUEST['btnSubmit'] == 'Admin' && is_admin()) { +} elseif ($_REQUEST['action'] == 'Admin' && is_admin()) { $pass = $_REQUEST['passwd']; // passwd is clean $waiting = $_REQUEST['waiting']; if ($waiting) { - print ' View all
'; + print ' View all
'; print "

View all waiting testimonials

"; } else { - print ' View Waiting
'; + print ' View Waiting
'; print "

View all testimonials

"; } if ($handle = opendir($dat_dir)) { /* Ceci est la facon correcte de traverser un dossier. */ - while (false !== ($file = readdir($handle))) { - if (preg_match("/profile.[a-z0-9\.]+/", $file)) { - $form = load_formul("$dat_dir/$file") ; - // on affiche ceux qui sont en attente ou bien tous - if (!$waiting || !$form['visible']) { - print_formul($form); - if ($form['visible']) { - print " Hide | \n"; - } else { - print " Accept | \n"; - } - print " Modify | \n"; - print " Export

\n"; - - } + while (false !== ($file = readdir($handle))) { + if (preg_match("/profile.[a-z0-9\.]+/", $file)) { + $form = load_formul("$dat_dir/$file") ; + // on affiche ceux qui sont en attente ou bien tous + if (!$waiting || !$form['visible']) { + print_formul($form); + if ($form['visible']) { + print " Hide | \n"; + } else { + print " Accept | \n"; + } + print " Modify | \n"; + print " Export

\n"; + } - } - closedir($handle); + } + } + closedir($handle); } -} elseif (!$_REQUEST['btnSubmit'] || $_REQUEST['btnSubmit'] == 'ViewAll') { +} elseif (!$_REQUEST['action'] || $_REQUEST['action'] == 'ViewAll') { $limit = $_REQUEST['limit']; $offset = $_REQUEST['offset']; @@ -638,7 +747,7 @@ if ($_REQUEST['btnSubmit'] == 'Modify') { if ($limit > 20) { $limit = 20 ;} - echo "Add a testimonial

"; + echo "Add a testimonial

"; if ($handle = opendir($dat_dir)) { /* Ceci est la facon correcte de traverser un dossier. */ @@ -657,7 +766,7 @@ if ($_REQUEST['btnSubmit'] == 'Modify') { closedir($handle); } -} elseif ($_REQUEST['btnSubmit'] == 'AdminExport' && is_admin()) { +} elseif ($_REQUEST['action'] == 'AdminExport' && is_admin()) { $file = get_file_from_id(); if (!$file) { @@ -668,7 +777,7 @@ if ($_REQUEST['btnSubmit'] == 'Modify') { export_form($form); } } else { - print "Invalid btnSubmit
"; + print "Invalid action
"; } function export_form($formul) @@ -725,7 +834,7 @@ function send_email($id, $email) // The message $message = "Hello, -You can modify your new testimonial at http://www.bacula.org/?page=testimonial&btnSubmit=Modify&id=$id +You can modify your new testimonial at http://www.bacula.org/?page=testimonial&action=Modify&id=$id Best regards. "; @@ -865,7 +974,7 @@ function print_formul_file($filename, $admin) { return 0; } } else { - print "Modify
\n"; + print "Modify
\n"; } return print_formul($formul); -- 2.39.5