From: Eric Bollengier Date: Mon, 22 Mar 2010 08:04:00 +0000 (+0100) Subject: add french testimonial X-Git-Tag: Release-5.0.2~5 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=84caad84e74ca8d8967ee8a0f23801c072c17432;p=bacula%2Fdocs add french testimonial --- diff --git a/docs/home-page/fr/pages/testimonial.php b/docs/home-page/fr/pages/testimonial.php new file mode 100644 index 00000000..f0c18da1 --- /dev/null +++ b/docs/home-page/fr/pages/testimonial.php @@ -0,0 +1,1238 @@ + "SELECT ONE", + '100' => "Church / Religious Organization", + '101' => "Corporation", + '102' => "Educational Institution", + '103' => "Government", + '104' => "Military", + '105' => "Non-Profit Organization", + '107' => "Small Business", + '106' => "Other" +); + +$version_lst = array( + 'empty' => "SELECT ONE", + '208' => "5.0.x", + '207' => "3.0.x", + '200' => "1.36.x", + '201' => "1.38.x", + '202' => "2.0.x", + '203' => "2.2.x", + '206' => "2.4.x", + '204' => "GIT master version" +); + +$catalog_lst = array( + 'empty' => "SELECT ONE", + '300' => "MySQL", + '301' => "PostgreSQL", + '303' => "SqLite" +); + +$org_industry_lst = array( + 'empty' => 'SELECT ONE', '400' => 'Aerospace / Aeronautical', + '401' => 'Agriculture / Farming', '402' => 'Architecture / Design', + '403' => 'Arts', '404' => 'ASP', + '405' => 'Banking', + '406' => 'Church / Religious Organization', '407' => 'Coaching', + '408' => 'Construction', '409' => 'Consulting (General)', + '410' => 'Consulting (Information Technology)','411' => 'Defense Industry', + '412' => 'Education / Training', '413' => 'Energy Industry', + '414' => 'Engineering', '415' => 'Entertainment (Film)', + '416' => 'Entertainment (Music)', '417' => 'Entertainment (Other)', + '418' => 'Event Management / Conferences', '419' => 'Finance / Banking / Accounting', + '420' => 'Food Service Industry', '421' => 'Government', + '422' => 'Healthcare / Medicine', '423' => 'Higher Education', + '424' => 'Insurance', '425' => 'Internet Service Provider', + '426' => 'K-12 Education', '427' => 'Law Enforcement / Emergency Management', + '428' => 'Legal', '429' => 'Manufacturing (Computer Equipment)', + '430' => 'Manufacturing (General)', '431' => 'Media (Publishing, Broadcasting, etc)', + '432' => 'Military', '433' => 'Mining', + '434' => 'Natural Resources / Environment', '435' => 'Pharmaceuticals', + '436' => 'Public Relations / Advertising', '437' => 'Real Estate', + '438' => 'Retail / Consumer Goods', '439' => 'Sales / Marketing', + '440' => 'Scientific Research', '441' => 'Sports / Recreation', + '442' => 'Technical College / Trade School', '443' => 'Telecommunications', + '444' => 'Transportation Industry (Air)', '445' => 'Transportation Industry (General)', + '446' => 'Transportation Industry (Marine)', '447' => 'Travel / Tourism / Lodging', + '448' => 'Travel Industry', '449' => 'Utilities / Public Works', + '450' => 'Other' +); + +$os_lst = array( + 'empty' => 'SELECT ONE', '500' => 'AIX', + '501' => 'FreeBSD', '502' => 'HP-UX', + '503' => 'Linux (Debian)', '504' => 'Linux (Fedora)', + '505' => 'Linux (Gentoo)', '506' => 'Linux (Mandriva)', + '507' => 'Linux (Other)', '508' => 'Linux (RedHat)', + '509' => 'Linux (Slackware)', '510' => 'Linux (Suse)', + '511' => 'Mac OS X', '512' => 'NetBSD', + '513' => 'OpenBSD', '514' => 'Other', + '515' => 'Solaris', '516' => 'Windows 2000', + '517' => 'Windows 2003', '518' => 'Windows XP', + '519' => 'Windows Vista' +); + +$country_lst = array( + 'empty' => 'SELECT ONE', '1001' => 'Afghanistan', + '1002' => 'Albania', '1003' => 'Algeria', + '1004' => 'American Samoa', '1005' => 'Andorra', + '1006' => 'Angola', '1007' => 'Anguilla', + '1008' => 'Antarctica', '1009' => 'Antigua and Barbuda', + '1010' => 'Argentina', '1011' => 'Armenia', + '1012' => 'Aruba', '1013' => 'Australia', + '1014' => 'Austria', '1015' => 'Azerbaijan', + '1016' => 'Bahamas', '1017' => 'Bahrain', + '1018' => 'Bangladesh', '1019' => 'Barbados', + '1020' => 'Belarus', '1021' => 'Belgium', + '1022' => 'Belize', '1023' => 'Benin', + '1024' => 'Bermuda', '1025' => 'Bhutan', + '1026' => 'Bolivia', '1027' => 'Bosnia and Herzegovina', + '1028' => 'Botswana', '1029' => 'Bouvet Island', + '1030' => 'Brazil', '1031' => 'Brunei Darussalam', + '1032' => 'Bulgaria', '1033' => 'Burkina Faso', + '1034' => 'Burundi', '1035' => 'Cambodia', + '1036' => 'Cameroon', '1037' => 'Canada', + '1038' => 'Cape Verde', '1039' => 'Cayman Islands', + '1040' => 'Central African Republic','1041' => 'Chad', + '1042' => 'Chile', '1043' => 'China', + '1044' => 'Christmas Island', '1045' => 'Colombia', + '1046' => 'Comoros', '1047' => 'Congo', + '1048' => 'Cook Islands', '1049' => 'Costa Rica', + '1054' => "Ivory Coast", '1050' => 'Croatia', + '1051' => 'Cuba', '1052' => 'Cyprus', + '1053' => 'Czech Republic', '1055' => 'Denmark', + '1056' => 'Djibouti', '1057' => 'Dominica', + '1058' => 'Dominican Republic', '1059' => 'East Timor', + '1060' => 'Ecuador', '1061' => 'Egypt', + '1062' => 'El Salvador', '1063' => 'Equatorial Guinea', + '1064' => 'Eritrea', '1065' => 'Estonia', + '1066' => 'Ethiopia', '1067' => 'Falkland Islands', + '1068' => 'Faroe Islands', '1069' => 'Fiji', + '1070' => 'Finland', '1071' => 'France', + '1072' => 'French Guiana', '1073' => 'French Polynesia', + '1074' => 'Gabon', '1075' => 'Gambia', + '1076' => 'Georgia', '1077' => 'Germany', + '1078' => 'Ghana', '1079' => 'Gibraltar', + '1080' => 'Greece', '1081' => 'Greenland', + '1082' => 'Grenada', '1083' => 'Guadeloupe', + '1084' => 'Guam', '1085' => 'Guatemala', + '1086' => 'Guinea', '1087' => 'Guinea-Bissau', + '1088' => 'Guyana', '1089' => 'Haiti', + '1090' => 'Honduras', '1091' => 'Hong Kong', + '1092' => 'Hungary', '1093' => 'Iceland', + '1094' => 'India', '1095' => 'Indonesia', + '1096' => 'Iran', '1097' => 'Iraq', + '1098' => 'Ireland', '1099' => 'Israel', + '1100' => 'Italy', '1101' => 'Jamaica', + '1102' => 'Japan', '1103' => 'Jordan', + '1104' => 'Kazakstan', '1105' => 'Kenya', + '1106' => 'Kiribati', '1107' => 'Kuwait', + '1108' => 'Kyrgystan', '1109' => 'Lao', + '1110' => 'Latvia', '1111' => 'Lebanon', + '1112' => 'Lesotho', '1113' => 'Liberia', + '1232' => 'Libya', '1114' => 'Liechtenstein', + '1115' => 'Lithuania', '1116' => 'Luxembourg', + '1117' => 'Macau', '1118' => 'Macedonia (FYR)', + '1119' => 'Madagascar', '1120' => 'Malawi', + '1121' => 'Malaysia', '1122' => 'Maldives', + '1123' => 'Mali', '1124' => 'Malta', + '1125' => 'Marshall Islands', '1126' => 'Martinique', + '1127' => 'Mauritania', '1128' => 'Mauritius', + '1129' => 'Mayotte', '1130' => 'Mexico', + '1131' => 'Micronesia', '1132' => 'Moldova', + '1133' => 'Monaco', '1134' => 'Mongolia', + '1135' => 'Montserrat', '1136' => 'Morocco', + '1137' => 'Mozambique', '1138' => 'Myanmar', + '1139' => 'Namibia', '1140' => 'Nauru', + '1141' => 'Nepal', '1142' => 'Netherlands', + '1143' => 'Netherlands Antilles', '1144' => 'Neutral Zone', + '1145' => 'New Caledonia', '1146' => 'New Zealand', + '1147' => 'Nicaragua', '1148' => 'Niger', + '1149' => 'Nigeria', '1150' => 'Niue', + '1151' => 'Norfolk Island', '1152' => 'North Korea', + '1153' => 'Northern Mariana Islands', '1154' => 'Norway', + '1155' => 'Oman', '1156' => 'Pakistan', + '1157' => 'Palau', '1158' => 'Panama', + '1159' => 'Papua New Guinea', '1160' => 'Paraguay', + '1161' => 'Peru', '1162' => 'Philippines', + '1163' => 'Pitcairn', '1164' => 'Poland', + '1165' => 'Portugal', '1166' => 'Puerto Rico', + '1167' => 'Qatar', '1168' => 'Reunion', + '1169' => 'Romania', '1170' => 'Russian Federation', + '1171' => 'Rwanda', '1172' => 'Saint Helena', + '1173' => 'Saint Kitts and Nevis', '1174' => 'Saint Lucia', + '1175' => 'Saint Pierre and Miquelon','1231' => 'Saint Vincent and the Grenadines', + '1176' => 'Samoa', '1177' => 'San Marino', + '1178' => 'Sao Tome and Principe', '1179' => 'Saudi Arabia', + '1180' => 'Senegal', '1227' => 'Serbia and Montenegro', + '1181' => 'Seychelles', '1182' => 'Sierra Leone', + '1183' => 'Singapore', '1184' => 'Slovakia', + '1185' => 'Slovenia', '1186' => 'Solomon Islands', + '1187' => 'Somalia', '1188' => 'South Africa', + '1189' => 'South Georgia', '1190' => 'South Korea', + '1191' => 'Spain', '1192' => 'Sri Lanka', + '1193' => 'Sudan', '1194' => 'Suriname', + '1195' => 'Swaziland', '1196' => 'Sweden', + '1197' => 'Switzerland', '1198' => 'Syria', + '1199' => 'Taiwan', '1200' => 'Tajikistan', + '1201' => 'Tanzania', '1202' => 'Thailand', + '1203' => 'Togo', '1204' => 'Tokelau', + '1205' => 'Tonga', '1206' => 'Trinidad and Tobago', + '1207' => 'Tunisia', '1208' => 'Turkey', + '1209' => 'Turkmenistan', '1210' => 'Turks and Caicos Islands', + '1211' => 'Tuvalu', '1212' => 'Uganda', + '1213' => 'Ukraine', '1214' => 'United Arab Emirates', + '1215' => 'United Kingdom', '1216' => 'United States of America', + '1217' => 'Uruguay', '1218' => 'Uzbekistan', + '1219' => 'Vanuatu', '1233' => 'Vatican City', + '1220' => 'Venezuela', '1221' => 'Vietnam', + '1222' => 'Virgin Islands (British)', '1223' => 'Virgin Islands (U.S.)', + '1224' => 'Wallis and Futuna Islands','1225' => 'Western Sahara', + '1226' => 'Yemen', '1228' => 'Zaire', + '1229' => 'Zambia', '1230' => 'Zimbabwe' +); + +admin_link(); + +if ($_REQUEST['action'] == 'Add' or $_REQUEST['action'] == 'Modify') +{ + +?> + + + + + + + + + + + + + + + + + + + + + + +
+ Testimonial +
+ +Want to let others know you're using Bacula? Submit a user profile! Your +submission will be reviewed before being made publicly available. We reserve +the right to edit your submission for spelling, grammar, etc. You will receive +an email when your profile has been approved for public viewing. Note that +while your contact name and email address are required (to verify +information if necessary), you can choose to have them not be published along +with your profile information. +

+Fields marked with a * are required. Read the privacy notice below for +information about how this data will be used. + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+*Contact Name:Publish Contact Name?
*Email Address:Publish Email Address? +
Job Description/Title: +

*Organization Name: + +Publish Org Name? +
*Organization Type: + +
*Organization Industry/Function: + +
+*Approx. Organization Size (# of Users): +Publish Org Size?
Website URL: +Publish Website? +
Organization Logo : + +max width 150px. png, gif or jpeg only
*Country: + +

*Bacula version: + +
*Director OS: + +
*Catalog DB: + +
*Redundant/Failover Backup Setup?
*Number of Director (Running bacula-dir): +
*Number of Clients (Running bacula-fd): +
+*Number of Storage Daemons (Running bacula-sd): +
*Total # of GB saved every month:
*Number # of Files:
Need professional support: +

Applicable Hardware and Network Information: + +
General Comments: +
+"; + echo ""; + echo "
"; + echo "
"; + +} else { + echo ""; +} +?> + +
+
+ +
+

Getting backup information

+To get Total # of GB saved every month, you can run this query on you catalog (just adapt the starttime condition and round the result) +
+bacula@yourdir:~$ bconsole
+*sql
+SELECT sum(JobBytes)/1073741824 FROM Job WHERE StartTime > '2008-02-07' AND Type = 'B'
+
+ +To know how many files are in your catalog, you can run this: +
+bacula@yourdir:~$ bconsole
+*sql
+SELECT sum(JobFiles) FROM Job WHERE Type = 'B'
+
+
+

Privacy Notice

+ +The following information is required, but you may choose to not have it +published for public viewing if you wish: contact name, email address, +organization name. We may use this information to verify the data you submit if +we find the need. +
+\n"; + $attribs = array('contact_name','email_address', 'org_name','title','website', + 'month_gb','number_files', 'number_dir','number_fd','number_sd', + 'org_size','id'); + foreach ($attribs as $arr) { + form_set_value($formul, $arr); + } + + $attribs = array('publish_contact','publish_email', 'publish_orgname', 'orgtype_id', + 'orgindustry_id', 'publish_orgsize','publish_website', 'bacula_version', + 'country_id','ostype_id', 'redundant_setup', 'catalog_id', 'support'); + foreach ($attribs as $arr) { + form_set_selection($formul, $arr); + } + + $attribs = array('comments', 'hardware_comments'); + foreach ($attribs as $arr) { + form_set_text($formul, $arr); + } + + + echo "\n"; + +} elseif ($_REQUEST['action'] == 'Review Profile Submission') { + + $form = get_formul(); + if (!$form) { + echo "Sorry, something is missing, I can't accept your submission"; + } else { + $token = uniqid(md5(rand()), true); + $filename = "$dat_dir/profile.$token"; + + $form['filename'] = $filename; + $form['id'] = $token; + $form['visible']=0; + save_formul($form); + + send_email($form['id'], $form['contact_name'], $form['email_address']); + echo "You can modify your profile here (keep this link as bookmark)

"; + print_formul($form); + } + +} elseif ($_REQUEST['action'] == 'View') { + + $file = get_file_from_id(); + + if ($file) { + print_formul_file($filename,true); + } + +} elseif ($_REQUEST['action'] == 'Delete') { + + $filename = get_file_from_id(); + + if (!$filename) { + return (0); + } + + $form = load_formul($filename); + + if ($form['org_logo'] && file_exists($form['org_logo'])) { + rename($upload_dir + $form['org_logo'], 'removed.' + $upload_dir + $form['org_logo']); + } + if (file_exists($filename)) { + rename($filename, "$filename-removed"); + echo "Profile deleted"; + } + +} elseif ($_REQUEST['action'] == 'Accept' && is_admin()) { + + $filename = get_file_from_id(); + + if (!$filename) { + return (0); + } + + $form = load_formul($filename); + + $hide = $_REQUEST['hide']; + + if ($hide) { + $form['visible']=0; + } else { + $form['visible']=1; + } + save_formul($form); + echo $form['id'] . " is now " . ($hide?"un":"") . "visible"; + print_formul($form); + +} elseif ($_REQUEST['action'] == 'Save') { + + $filename = get_file_from_id(); + + if (!$filename) { + return (0); + } + + $form = get_formul(); + + $form['filename'] = $filename; + $form['id'] = $_REQUEST['id']; // id is clean +// $form['visible'] = false; + + if (!$form['org_logo']) { + $form_old = load_formul($filename); + $form['org_logo'] = $form_old['org_logo']; + } + + save_formul($form); + + echo "Your profile has been modified.
"; + print_formul($form); + +} elseif ($_REQUEST['action'] == 'Admin' && is_admin()) { + + view_all(); + +} elseif (!$_REQUEST['action'] || $_REQUEST['action'] == 'ViewAll') { + + echo "Add your testimonial

"; + view_all(); + +} elseif ($_REQUEST['action'] == 'AdminExport' && is_admin()) { + + $file = get_file_from_id(); + if (!$file) { + return 0; + } + $form = load_formul($file); + if ($form) { + export_form($form); + } +} elseif ($_REQUEST['action'] == 'sql') { + print "
";
+   dump_sql();
+   print "
"; +} + +function view_all() +{ + global $dat_dir; + global $password; + + $limit = $_REQUEST['limit']; + $offset = $_REQUEST['offset']; + + $limit = is_numeric($limit)?$limit:5; + $offset = is_numeric($offset)?$offset:0; + $max = $offset + $limit; + + $admin = is_admin(); + if ($limit > 20) { $limit = 20 ;} + + if ($handle = opendir($dat_dir)) { + /* Ceci est la facon correcte de traverser un dossier. */ + $i = 0 ; + while (false !== ($file = readdir($handle))) { + if (preg_match("/^profile.[a-z0-9\.]+$/", $file)) { + if (($i >= $offset) && ($i < $max)) { + $i += print_formul_file("$dat_dir/$file",$admin); + } else { + $i++; + } + if ($i > $max) { + break; + } + } + } + closedir($handle); + } + if ($offset > 0) { + $offset = $offset - $limit; + if ($offset < 0) { + $offset=0; + } + echo "Prev "; + } + if ($i >= $max) { + $offset = $offset + $limit; + echo " Next
"; + } +} + +function export_form($formul) +{ + global $country_lst, $org_type_lst, $org_industry_lst, $os_lst, $catalog_lst, $version_lst; + + $attribs = array('contact_name','email_address', 'org_name','title','website', + 'hardware_comments','comments', + 'publish_contact','publish_email', 'publish_orgname','org_size','redundant_setup', + 'date','visible', 'support','number_dir', + 'number_fd','number_sd','month_gb','number_files','publish_orgsize','publish_website'); + print "
\n";
+        foreach ($attribs as $arr) {
+                print "$arr = " . $formul[$arr] . "\n";
+        }
+
+        print "orgtype = " . $org_type_lst[$formul['orgtype_id']] . "\n";
+        print "orgindustry = " . $org_industry_lst[$formul['orgindustry_id']] . "\n";
+        print "bacula_version = " . $version_lst[$formul['bacula_version']] . "\n";
+        print "country = " . $country_lst[$formul['country_id']] . "\n";
+        print "ostype = " . $os_lst[$formul['ostype_id']] . "\n";
+        print "catalog = " . $catalog_lst[$formul['catalog_id']] . "\n";
+
+        print "
\n";
+}
+
+function get_file_from_id()
+{
+    global $dat_dir;
+    $id = $_REQUEST['id'];
+
+    if (!ereg('^[a-zA-Z0-9\.]+$',$id)) {
+         return(0) ;
+    }
+
+    $filename="$dat_dir/profile.$id";
+
+    if (!file_exists($filename)) {
+         echo "Can't verify your id";
+         return (0);
+    }       
+
+    return $filename;
+}
+
+function send_email($id, $name, $email)
+{
+        // Your email address
+//        $from = 'kern@sibbald.com';
+        $from = 'eric@eb.homelinux.org';
+
+        // The subject
+        $subject = "[BACULA] New testimonial";
+
+        // The message
+        $message = "Hello, 
+You can modify your new testimonial at http://www.bacula.org/en/?page=testimonial&action=Modify&id=$id
+
+Best regards.
+";
+
+        mail($email, $subject, $message, "From: Bacula WebMaster <$from>");
+
+        $message = "Hello, 
+You can review this testimonial at http://www.bacula.org/en/?page=testimonial&action=Modify&id=$id
+
+Best regards.
+";
+
+        
+        mail('testimonial@baculasystems.com', $subject, $message, "From: $name <$email>");
+
+        echo "The email has been sent for approval.
"; +} + +function save_formul($form) +{ + $fp = fopen($form['filename'], 'w'); + fwrite($fp, serialize($form)); + fclose($fp); +} + +function get_formul() +{ + global $upload_dir; + global $dat_dir; + $formul = array(); + $attribs = array('contact_name','email_address', 'org_name'); + foreach ($attribs as $arr) { + if (!$_REQUEST[$arr]) { + echo "Can't get $arr
"; + return ''; + } + $formul[$arr] = preg_replace('/[^a-zA-Z0-9!\.?\:\/,;_()@\n -]/', " ", $_REQUEST[$arr]); + } + + $attribs = array('title','website','hardware_comments','comments') ; + foreach ($attribs as $arr) { + $formul[$arr] = preg_replace('/[^a-zA-Z0-9!\.?\:\/,;_()@\n -]/', " ", $_REQUEST[$arr]); + } + /* Disallow http:// links into comments field */ + $m = array(); + preg_match('/http:\/\//', $_REQUEST['comments'], $m); + if (sizeof($m) > 2) { + return ''; + } + $m = array(); + preg_match('/http:\/\//', $_REQUEST['hardware_comments'], $m); + if (sizeof($m) > 2) { + return ''; + } + /* Disallow when number of dir too big or > number of fd */ + if (intval($_REQUEST['number_dir']) > 100 || + intval($_REQUEST['number_dir']) > intval($_REQUEST['number_fd'])) { + return ''; + } + $attribs = array('publish_contact','publish_email', 'publish_orgname', 'orgtype_id', + 'orgindustry_id','org_size', 'publish_orgsize','publish_website', 'bacula_version', + 'country_id','ostype_id', 'redundant_setup','number_fd','number_sd','support', + 'month_gb','number_files','catalog_id','number_dir'); + foreach ($attribs as $arr) { + $tmp = $_REQUEST[$arr]; + $tmp = preg_replace("/[,\.]/", "", $tmp); + if (preg_match("/^[0-9]+$/", $tmp)) { + $formul[$arr] = $_REQUEST[$arr]; + } + } + + $attribs = array('orgtype_id', 'orgindustry_id', 'org_size', 'country_id','bacula_version', + 'catalog_id', 'ostype_id','number_fd','number_sd', 'number_dir', 'month_gb','number_files'); + foreach ($attribs as $arr) { + if (!$formul[$arr]) { + echo "Can't get $arr
"; + return ''; + } + } + + if ($_FILES['org_logo']) { + $token = uniqid(md5(rand()), true); + $image = "/upload/$token"; + + if (preg_match("/(jpg|jpeg)$/i", $_FILES['org_logo']['name'])) { + $image = "$image.jpg"; + } elseif (preg_match("/png$/i", $_FILES['org_logo']['name'])) { + $image = "$image.png"; + } elseif (preg_match("/gif$/i", $_FILES['org_logo']['name'])) { + $image = "$image.gif"; + } else { + $image = ''; + } + if ($image) { + $ret=move_uploaded_file($_FILES['org_logo']['tmp_name'], "$upload_dir/$image"); + $formul['org_logo'] = $image; + } + } + $formul['date'] = time(); + $formul['visible'] = false; + + return $formul; +} + +function form_set_value($formul,$val) +{ + echo "document.getElementById('$val').value = '" . $formul[$val] . "';\n"; +} + +function form_set_selection($formul,$val) +{ + echo "document.getElementById('${val}_" . $formul[$val] . "').selected =true;\n"; +} + +function form_set_text($formul,$val) +{ + $temp = $formul[$val]; + $temp = str_replace(array("\n", "\r"), array("\\n",""), $temp); + echo "document.getElementById('$val').value='" . $temp . "';\n"; +} + +// passwd file must exist in dat directory +function is_admin() +{ + global $dat_dir; + $id = $_REQUEST['p']; + + if (!$id) { + return(false); + } + + if (!ereg('^[a-zA-Z]+$',$id)) { + return(false) ; + } + + if (file_exists("$dat_dir/$id")) { + return true; + } else { + return false; + } +} + +function admin_link() +{ + global $password; + if (is_admin()) { + $pass = $_REQUEST['p']; + $waiting = $_REQUEST['waiting']; + $password = "&p=$pass"; + print "Admin: "; + if ($waiting) { + print " View all
"; + } else { + print " View all | "; + print " View Waiting
"; + } + print "
"; + } +} + +function load_formul($filename) +{ + if (!file_exists($filename)) { + return array(); + } + + if (!filesize($filename) || filesize($filename) > 10*1024*1024) { + return undef; + } + $fp = fopen($filename, 'r'); + $contents = fread ($fp, filesize ($filename)); + fclose ($fp); + + $formul = unserialize($contents); + if (!is_array($formul)) { + return undef; + } + + return $formul; +} + +function print_formul_file($filename, $admin) { + global $password; + $form = load_formul($filename); + if (!$form) { + return 0; + } + + if (!$admin) { + if (!$form['visible']) { + return 0; + } + } + $waiting = $_REQUEST['waiting']; + if ($admin && $waiting && $form['visible']) { + return 0; + } + + $ret = print_formul($form); + if ($admin) { + if ($form['visible']) { + print " Hide | \n"; + } else { + print " Accept | \n"; + } + print " Modify | \n"; + print " Export

\n"; + } + return $ret; +} + +function dump_sql() +{ + global $dat_dir, $country_lst, $org_type_lst, $org_industry_lst, $os_lst,$catalog_lst, $version_lst; + if (!is_admin()) { + return; + } +?> + CREATE TABLE dict (lang text, id int, name text, primary key (lang, id)); + CREATE TABLE testimonials ( + contact_name text, + email_address text, + org_name text, + title text DEFAULT '', + website text DEFAULT '', + filename text DEFAULT '', + month_gb int DEFAULT 0, + number_files bigint DEFAULT 0, + number_dir int DEFAULT 0, + number_fd int DEFAULT 0, + number_sd int DEFAULT 0, + org_size int DEFAULT 0, + + country_id int, + ostype_id int, + bacula_version int, + contry_id int, + orgindustry_id int, + orgtype_id int, + catalog_id int, + + id text, + publish_contact int DEFAULT 0, + publish_email int DEFAULT 0, + publish_website int DEFAULT 0, + publish_orgname int DEFAULT 0, + publish_orgsize int DEFAULT 0, + redundant_setup int DEFAULT 0, + support int DEFAULT 0, + comments text DEFAULT '', + hardware_comments text DEFAULT '', + visible int DEFAULT 0, + org_logo text DEFAULT '', + date int DEFAULT 0, + lastmodifed int DEFAULT 0 + ); + + CREATE VIEW reference AS SELECT contact_name,email_address,org_name,title,website,hardware_comments,comments, + publish_contact,publish_email,publish_orgname,org_size,publish_orgsize,publish_website, + redundant_setup,number_fd,number_sd,support,month_gb,number_files,number_dir,date,visible,filename,t.id, + orgtype.name AS orgtype, + orgindustry.name AS orgindustry, + version.name AS bacula_version, + country.name AS country, + ostype.name AS ostype, + catalog.name AS catalog + FROM testimonials AS t, dict AS orgtype, dict AS orgindustry, dict AS version, dict AS country, dict AS ostype, + dict AS catalog + + WHERE t.orgtype_id = orgtype.id AND orgtype.lang = 'en' + AND t.orgindustry_id = orgindustry.id AND orgindustry.lang = 'en' + AND t.bacula_version = version.id AND version.lang = 'en' + AND t.country_id = country.id AND country.lang = 'en' + AND t.ostype_id = ostype.id AND ostype.lang = 'en' + AND t.catalog_id = catalog.id AND catalog.lang = 'en'; + + + INSERT INTO dict (lang, id, name) VALUES ('en', 0, 'no'); + INSERT INTO dict (lang, id, name) VALUES ('en', 1, 'yes'); + + +
+
+ + + + + + + + + + + + + + + 1) { ?> + + + + 1) { ?> + + + + + + + + + + + +
Date:
Location:
Organization Type:
Industry/Function:
Organisation Size:
Website:
Number of fd:
GB/Month:
Comments:
+ + + +
+ +