2 require_once("inc/header.php");
4 $dat_dir = '/var/www/testimonials';
5 $upload_dir = '/var/www/bacula';
10 'empty' => "SELECT ONE",
11 '100' => "Church / Religious Organization",
12 '101' => "Corporation",
13 '102' => "Educational Institution",
14 '103' => "Government",
16 '105' => "Non-Profit Organization",
17 '107' => "Small Business",
22 'empty' => "SELECT ONE",
30 '204' => "GIT master version"
34 'empty' => "SELECT ONE",
36 '301' => "PostgreSQL",
40 $org_industry_lst = array(
41 'empty' => 'SELECT ONE', '400' => 'Aerospace / Aeronautical',
42 '401' => 'Agriculture / Farming', '402' => 'Architecture / Design',
43 '403' => 'Arts', '404' => 'ASP',
45 '406' => 'Church / Religious Organization', '407' => 'Coaching',
46 '408' => 'Construction', '409' => 'Consulting (General)',
47 '410' => 'Consulting (Information Technology)','411' => 'Defense Industry',
48 '412' => 'Education / Training', '413' => 'Energy Industry',
49 '414' => 'Engineering', '415' => 'Entertainment (Film)',
50 '416' => 'Entertainment (Music)', '417' => 'Entertainment (Other)',
51 '418' => 'Event Management / Conferences', '419' => 'Finance / Banking / Accounting',
52 '420' => 'Food Service Industry', '421' => 'Government',
53 '422' => 'Healthcare / Medicine', '423' => 'Higher Education',
54 '424' => 'Insurance', '425' => 'Internet Service Provider',
55 '426' => 'K-12 Education', '427' => 'Law Enforcement / Emergency Management',
56 '428' => 'Legal', '429' => 'Manufacturing (Computer Equipment)',
57 '430' => 'Manufacturing (General)', '431' => 'Media (Publishing, Broadcasting, etc)',
58 '432' => 'Military', '433' => 'Mining',
59 '434' => 'Natural Resources / Environment', '435' => 'Pharmaceuticals',
60 '436' => 'Public Relations / Advertising', '437' => 'Real Estate',
61 '438' => 'Retail / Consumer Goods', '439' => 'Sales / Marketing',
62 '440' => 'Scientific Research', '441' => 'Sports / Recreation',
63 '442' => 'Technical College / Trade School', '443' => 'Telecommunications',
64 '444' => 'Transportation Industry (Air)', '445' => 'Transportation Industry (General)',
65 '446' => 'Transportation Industry (Marine)', '447' => 'Travel / Tourism / Lodging',
66 '448' => 'Travel Industry', '449' => 'Utilities / Public Works',
71 'empty' => 'SELECT ONE', '500' => 'AIX',
72 '501' => 'FreeBSD', '502' => 'HP-UX',
73 '503' => 'Linux (Debian)', '504' => 'Linux (Fedora)',
74 '505' => 'Linux (Gentoo)', '506' => 'Linux (Mandriva)',
75 '507' => 'Linux (Other)', '508' => 'Linux (RedHat)',
76 '509' => 'Linux (Slackware)', '510' => 'Linux (Suse)',
77 '511' => 'Mac OS X', '512' => 'NetBSD',
78 '513' => 'OpenBSD', '514' => 'Other',
79 '515' => 'Solaris', '516' => 'Windows 2000',
80 '517' => 'Windows 2003', '518' => 'Windows XP',
81 '519' => 'Windows Vista'
85 'empty' => 'SELECT ONE', '1001' => 'Afghanistan',
86 '1002' => 'Albania', '1003' => 'Algeria',
87 '1004' => 'American Samoa', '1005' => 'Andorra',
88 '1006' => 'Angola', '1007' => 'Anguilla',
89 '1008' => 'Antarctica', '1009' => 'Antigua and Barbuda',
90 '1010' => 'Argentina', '1011' => 'Armenia',
91 '1012' => 'Aruba', '1013' => 'Australia',
92 '1014' => 'Austria', '1015' => 'Azerbaijan',
93 '1016' => 'Bahamas', '1017' => 'Bahrain',
94 '1018' => 'Bangladesh', '1019' => 'Barbados',
95 '1020' => 'Belarus', '1021' => 'Belgium',
96 '1022' => 'Belize', '1023' => 'Benin',
97 '1024' => 'Bermuda', '1025' => 'Bhutan',
98 '1026' => 'Bolivia', '1027' => 'Bosnia and Herzegovina',
99 '1028' => 'Botswana', '1029' => 'Bouvet Island',
100 '1030' => 'Brazil', '1031' => 'Brunei Darussalam',
101 '1032' => 'Bulgaria', '1033' => 'Burkina Faso',
102 '1034' => 'Burundi', '1035' => 'Cambodia',
103 '1036' => 'Cameroon', '1037' => 'Canada',
104 '1038' => 'Cape Verde', '1039' => 'Cayman Islands',
105 '1040' => 'Central African Republic','1041' => 'Chad',
106 '1042' => 'Chile', '1043' => 'China',
107 '1044' => 'Christmas Island', '1045' => 'Colombia',
108 '1046' => 'Comoros', '1047' => 'Congo',
109 '1048' => 'Cook Islands', '1049' => 'Costa Rica',
110 '1054' => "Ivory Coast", '1050' => 'Croatia',
111 '1051' => 'Cuba', '1052' => 'Cyprus',
112 '1053' => 'Czech Republic', '1055' => 'Denmark',
113 '1056' => 'Djibouti', '1057' => 'Dominica',
114 '1058' => 'Dominican Republic', '1059' => 'East Timor',
115 '1060' => 'Ecuador', '1061' => 'Egypt',
116 '1062' => 'El Salvador', '1063' => 'Equatorial Guinea',
117 '1064' => 'Eritrea', '1065' => 'Estonia',
118 '1066' => 'Ethiopia', '1067' => 'Falkland Islands',
119 '1068' => 'Faroe Islands', '1069' => 'Fiji',
120 '1070' => 'Finland', '1071' => 'France',
121 '1072' => 'French Guiana', '1073' => 'French Polynesia',
122 '1074' => 'Gabon', '1075' => 'Gambia',
123 '1076' => 'Georgia', '1077' => 'Germany',
124 '1078' => 'Ghana', '1079' => 'Gibraltar',
125 '1080' => 'Greece', '1081' => 'Greenland',
126 '1082' => 'Grenada', '1083' => 'Guadeloupe',
127 '1084' => 'Guam', '1085' => 'Guatemala',
128 '1086' => 'Guinea', '1087' => 'Guinea-Bissau',
129 '1088' => 'Guyana', '1089' => 'Haiti',
130 '1090' => 'Honduras', '1091' => 'Hong Kong',
131 '1092' => 'Hungary', '1093' => 'Iceland',
132 '1094' => 'India', '1095' => 'Indonesia',
133 '1096' => 'Iran', '1097' => 'Iraq',
134 '1098' => 'Ireland', '1099' => 'Israel',
135 '1100' => 'Italy', '1101' => 'Jamaica',
136 '1102' => 'Japan', '1103' => 'Jordan',
137 '1104' => 'Kazakstan', '1105' => 'Kenya',
138 '1106' => 'Kiribati', '1107' => 'Kuwait',
139 '1108' => 'Kyrgystan', '1109' => 'Lao',
140 '1110' => 'Latvia', '1111' => 'Lebanon',
141 '1112' => 'Lesotho', '1113' => 'Liberia',
142 '1232' => 'Libya', '1114' => 'Liechtenstein',
143 '1115' => 'Lithuania', '1116' => 'Luxembourg',
144 '1117' => 'Macau', '1118' => 'Macedonia (FYR)',
145 '1119' => 'Madagascar', '1120' => 'Malawi',
146 '1121' => 'Malaysia', '1122' => 'Maldives',
147 '1123' => 'Mali', '1124' => 'Malta',
148 '1125' => 'Marshall Islands', '1126' => 'Martinique',
149 '1127' => 'Mauritania', '1128' => 'Mauritius',
150 '1129' => 'Mayotte', '1130' => 'Mexico',
151 '1131' => 'Micronesia', '1132' => 'Moldova',
152 '1133' => 'Monaco', '1134' => 'Mongolia',
153 '1135' => 'Montserrat', '1136' => 'Morocco',
154 '1137' => 'Mozambique', '1138' => 'Myanmar',
155 '1139' => 'Namibia', '1140' => 'Nauru',
156 '1141' => 'Nepal', '1142' => 'Netherlands',
157 '1143' => 'Netherlands Antilles', '1144' => 'Neutral Zone',
158 '1145' => 'New Caledonia', '1146' => 'New Zealand',
159 '1147' => 'Nicaragua', '1148' => 'Niger',
160 '1149' => 'Nigeria', '1150' => 'Niue',
161 '1151' => 'Norfolk Island', '1152' => 'North Korea',
162 '1153' => 'Northern Mariana Islands', '1154' => 'Norway',
163 '1155' => 'Oman', '1156' => 'Pakistan',
164 '1157' => 'Palau', '1158' => 'Panama',
165 '1159' => 'Papua New Guinea', '1160' => 'Paraguay',
166 '1161' => 'Peru', '1162' => 'Philippines',
167 '1163' => 'Pitcairn', '1164' => 'Poland',
168 '1165' => 'Portugal', '1166' => 'Puerto Rico',
169 '1167' => 'Qatar', '1168' => 'Reunion',
170 '1169' => 'Romania', '1170' => 'Russian Federation',
171 '1171' => 'Rwanda', '1172' => 'Saint Helena',
172 '1173' => 'Saint Kitts and Nevis', '1174' => 'Saint Lucia',
173 '1175' => 'Saint Pierre and Miquelon','1231' => 'Saint Vincent and the Grenadines',
174 '1176' => 'Samoa', '1177' => 'San Marino',
175 '1178' => 'Sao Tome and Principe', '1179' => 'Saudi Arabia',
176 '1180' => 'Senegal', '1227' => 'Serbia and Montenegro',
177 '1181' => 'Seychelles', '1182' => 'Sierra Leone',
178 '1183' => 'Singapore', '1184' => 'Slovakia',
179 '1185' => 'Slovenia', '1186' => 'Solomon Islands',
180 '1187' => 'Somalia', '1188' => 'South Africa',
181 '1189' => 'South Georgia', '1190' => 'South Korea',
182 '1191' => 'Spain', '1192' => 'Sri Lanka',
183 '1193' => 'Sudan', '1194' => 'Suriname',
184 '1195' => 'Swaziland', '1196' => 'Sweden',
185 '1197' => 'Switzerland', '1198' => 'Syria',
186 '1199' => 'Taiwan', '1200' => 'Tajikistan',
187 '1201' => 'Tanzania', '1202' => 'Thailand',
188 '1203' => 'Togo', '1204' => 'Tokelau',
189 '1205' => 'Tonga', '1206' => 'Trinidad and Tobago',
190 '1207' => 'Tunisia', '1208' => 'Turkey',
191 '1209' => 'Turkmenistan', '1210' => 'Turks and Caicos Islands',
192 '1211' => 'Tuvalu', '1212' => 'Uganda',
193 '1213' => 'Ukraine', '1214' => 'United Arab Emirates',
194 '1215' => 'United Kingdom', '1216' => 'United States of America',
195 '1217' => 'Uruguay', '1218' => 'Uzbekistan',
196 '1219' => 'Vanuatu', '1233' => 'Vatican City',
197 '1220' => 'Venezuela', '1221' => 'Vietnam',
198 '1222' => 'Virgin Islands (British)', '1223' => 'Virgin Islands (U.S.)',
199 '1224' => 'Wallis and Futuna Islands','1225' => 'Western Sahara',
200 '1226' => 'Yemen', '1228' => 'Zaire',
201 '1229' => 'Zambia', '1230' => 'Zimbabwe'
206 if ($_REQUEST['action'] == 'Add' or $_REQUEST['action'] == 'Modify')
211 <script type="text/javascript" language="JavaScript">
213 function validate_testimonial () {
216 var invalid_fields = new Array();
218 var form = document.forms['form1'];
219 // email: standard text, hidden, password, or textarea box
220 var email = form.elements['email_address'].value;
221 if (email == null || ! email.match(/^[\w\-\+\._]+\@[a-zA-Z0-9][-a-zA-Z0-9\.]*\.[a-zA-Z]+$/)) {
222 alertstr += '- Invalid entry for the "Email" field\n';
224 invalid_fields.push('email_address');
227 // contact_name: standard text, hidden, password, or textarea box
228 var contact_name = form.elements['contact_name'].value;
229 if (contact_name == null || ! contact_name.match(/^[a-zA-Z]+[- ]?[a-zA-Z]+\s*,?([a-zA-Z]+|[a-zA-Z]+\.)?$/)) {
230 alertstr += '- Invalid entry for the "Contact Name" field\n';
232 invalid_fields.push('contact_name');
235 // org_name: standard text, hidden, password, or textarea box
236 var org_name = form.elements['org_name'].value;
237 if (org_name == null || ! org_name.match(/^[a-zA-Z0-9();@%, :!\/]+$/)) {
238 alertstr += '- Invalid entry for the "Organization Name" field\n';
240 invalid_fields.push('org_name');
242 var number = form.elements['orgtype_id'].value;
243 if (number == null || ! number.match(/^[0-9]+$/)) {
244 alertstr += '- Choose one of the "Organization type" options\n';
245 invalid_fields.push('orgtype_id');
248 number = form.elements['orgindustry_id'].value;
249 if (number == null || ! number.match(/^[0-9]+$/)) {
250 alertstr += '- Choose one of the "Organization industry type" options\n';
251 invalid_fields.push('orgindustry_id');
254 var org_size = form.elements['org_size'].value;
255 if (org_size == null || ! org_size.match(/^[0-9,\.]+$/)) {
256 alertstr += '- Invalid entry for the "Organization size" field\n';
257 invalid_fields.push('org_size');
261 var bacula_version = form.elements['bacula_version'].value;
262 if (bacula_version == null || ! bacula_version.match(/^[0-9]+$/)) {
263 alertstr += '- Invalid entry for the "Bacula version" field\n';
264 invalid_fields.push('bacula_version');
267 var ostype = form.elements['ostype_id'].value;
268 if (ostype == null || ! ostype.match(/^[0-9]+$/)) {
269 alertstr += '- Choose one of the "Director OS" field\n';
270 invalid_fields.push('ostype_id');
273 var catalog = form.elements['catalog_id'].value;
274 if (catalog == null || ! catalog.match(/^[0-9]+$/)) {
275 alertstr += '- Choose one of the "Catalog type" field\n';
276 invalid_fields.push('catalog_id');
279 var comments = form.elements['comments'].value;
280 if (comments != null && comments.match(/http:\/\//)) {
281 alertstr += '- Invalid entry for the "Comments" field, we disallow spam url\n';
282 invalid_fields.push('comments');
285 comments = form.elements['hardware_comments'].value;
286 if (comments != null && comments.match(/http:\/\//)) {
287 alertstr += '- Invalid entry for the "Hardware comments" field, we disallow spam url\n';
288 invalid_fields.push('hardware_comments');
291 var number = form.elements['number_fd'].value;
292 if (number == null || ! number.match(/^[0-9,\.]+$/)) {
293 alertstr += '- Invalid entry for the "Number of Client" field\n';
294 invalid_fields.push('number_fd');
297 number = form.elements['number_sd'].value;
298 if (number == null || ! number.match(/^[0-9,\.]+$/)) {
299 alertstr += '- Invalid entry for the "Number of Storage" field\n';
300 invalid_fields.push('number_sd');
303 number = form.elements['number_dir'].value;
304 if (number == null || ! number.match(/^[0-9,\.]+$/) || number > 100) {
305 alertstr += '- Invalid entry for the "Number of Director" field\n';
306 invalid_fields.push('number_dir');
309 number = form.elements['month_gb'].value;
310 if (number == null || ! number.match(/^[0-9,\.]+$/)) {
311 alertstr += '- Invalid entry for the "Number GB/month" field\n';
312 invalid_fields.push('month_gb');
315 number = form.elements['number_files'].value;
316 if (number == null || ! number.match(/^[0-9,\.]+$/)) {
317 alertstr += '- Invalid entry for the "File number" field\n';
318 invalid_fields.push('number_files');
321 if (invalid > 0 || alertstr != '') {
322 if (! invalid) invalid = 'The following'; // catch for programmer error
323 alert(''+invalid+' error(s) were encountered with your submission:'+'\n\n'
324 +alertstr+'\n'+'Please correct these fields and try again.');
327 return true; // all checked ok
333 <td class="contentTopic">
334 <? echo $_REQUEST['action'] ?> Testimonial
340 Want to let others know you're using Bacula? Submit a user profile! Your
341 submission will be reviewed before being made publicly available. We reserve
342 the right to edit your submission for spelling, grammar, etc. You will receive
343 an email when your profile has been approved for public viewing. Note that
344 while your contact name and email address are required (to verify
345 information if necessary), you can choose to have them not be published along
346 with your profile information.
348 Fields marked with a * are required. Read the privacy notice below for
349 information about how this data will be used.
356 <form name='form1' enctype="multipart/form-data" method='post' action='?page=testimonial'>
357 <input type='hidden' name='page' value='testimonial'>
358 <table border='0' class='Content'>
360 <td class='ItemName'>
361 <font color='red'>*</font>Contact Name:</td>
362 <td class='ItemValue'><input type='text' class='ItemValue' id='contact_name'
363 name='contact_name' size='30' maxlength='100' value=''></td>
364 <td class='ItemName'>Publish Contact Name?</td>
365 <td class='ItemValue'><select name='publish_contact' class='ItemValue'>
366 <option id='publish_contact_0' value='0' SELECTED>No
367 <option id='publish_contact_1' value='1'>Yes
372 <td class='ItemName'><font color='red'>*</font>Email Address:</td>
373 <td class='ItemValue'><input type='text' class='ItemValue' name='email_address'
374 id='email_address' size='30' maxlength='150' value=''></td>
375 <td class='ItemName'>Publish Email Address?</td><td class='ItemValue'>
376 <select name='publish_email' class='ItemValue'>
377 <option value='0' id='publish_email_0' SELECTED>No
378 <option value='1' id='publish_email_1' >Yes
382 <tr><td class='ItemName'>Job Description/Title:</td>
383 <td class='ItemValue'>
384 <input type='text' name='title' id='title' size='30' maxlength='100' value=''></td></tr>
385 <tr><td colspan=4><br></td></tr>
387 <tr><td class='ItemName'><font color='red'>*</font>Organization Name:</td>
388 <td class='ItemValue'>
389 <input type='text' class='ItemValue' name='org_name' id='org_name'
390 size='30' maxlength='100' value=''>
391 </td><td class='ItemName'>Publish Org Name?</td><td class='ItemValue'>
392 <select name='publish_orgname' class='ItemValue'>
393 <option value='0' id='publish_orgname_0' >No
394 <option value='1' id='publish_orgname_1' SELECTED>Yes
398 <tr><td class='ItemName'><font color='red'>*</font>Organization Type:</td>
399 <td class='ItemValue' colspan='3'>
400 <select name='orgtype_id' class='ItemValue'>
403 while(list ($key, $val) = each ($org_type_lst))
405 echo "<option id='orgtype_id_$key' value='$key'>$val\n";
412 <tr><td class='ItemName'><font color='red'>*</font>Organization Industry/Function:</td>
413 <td class='ItemValue' colspan='3'>
414 <select name='orgindustry_id' class='ItemValue'>
417 while(list ($key, $val) = each ($org_industry_lst))
419 echo "<option id='orgindustry_id_$key' value='$key'>$val\n";
426 <tr><td class='ItemName'>
427 <font color='red'>*</font>Approx. Organization Size (# of Users):</td>
428 <td class='ItemValue'>
429 <input type='text' id='org_size' class='ItemValue' name='org_size'
430 size='4' maxlength='6' value=''></td>
431 <td class='ItemName'>Publish Org Size?</td><td class='ItemValue'><select name='publish_orgsize' class='ItemValue'>
432 <option id='publish_orgsize_0' value='0' >No
433 <option id='publish_orgsize_1' value='1' SELECTED>Yes
438 <td class='ItemName'>Website URL:</td>
439 <td class='ItemValue'>
440 <input type='text' class='ItemValue' id='website' name='website' size='30'
441 maxlength='150' value=''></td>
442 <td class='ItemName'>Publish Website?</td><td class='ItemValue'>
443 <select name='publish_website' class='ItemValue'>
444 <option id='publish_website_0' value='0' >No
445 <option id='publish_website_1' value='1' SELECTED>Yes
450 <td class='ItemName'>Organization Logo :</td>
451 <td class='ItemValue'>
452 <input type="file" name="org_logo" title="png, gif or jpeg file only please"/>
453 </td><td><i>max width 150px. png, gif or jpeg only</i></td>
456 <tr><td class='ItemName'><font color='red'>*</font>Country:</td>
457 <td class='ItemValue'>
458 <select name='country_id' class='ItemValue'>
460 while(list ($key, $val) = each ($country_lst))
462 echo "<option id='country_id_$key' value='$key'>$val\n";
469 <tr><td colspan=4><br></td></tr>
470 <tr><td class='ItemName'><font color='red'>*</font>Bacula version:</td>
471 <td class='ItemValue'>
472 <select name='bacula_version' class='ItemValue'>
475 while(list ($key, $val) = each ($version_lst))
477 echo "<option id='bacula_version_$key' value='$key'>$val\n";
483 <tr><td class='ItemName'><font color='red'>*</font>Director OS:</td>
484 <td class='ItemValue'>
485 <select name='ostype_id' class='ItemValue'>
488 while(list ($key, $val) = each ($os_lst))
490 echo "<option id='ostype_id_$key' value='$key'>$val\n";
496 <tr><td class='ItemName'><font color='red'>*</font>Catalog DB:</td>
497 <td class='ItemValue'>
498 <select name='catalog_id' class='ItemValue'>
501 while(list ($key, $val) = each ($catalog_lst))
503 echo "<option id='catalog_id_$key' value='$key'>$val\n";
510 <td class='ItemName'><font color='red'>*</font>Redundant/Failover Backup Setup?</td>
511 <td class='ItemValue'><select name='redundant_setup' class='ItemValue'>
512 <option value='0' id='redundant_setup_0' SELECTED>No
513 <option value='1' id='redundant_setup_1' >Yes
517 <tr><td class='ItemName'><font color='red'>*</font>Number of Director (Running bacula-dir):</td>
518 <td class='ItemValue'>
519 <input type='text' class='ItemValue' id='number_dir' name='number_dir'
520 size='5' maxlength='10' value=''></td>
523 <tr><td class='ItemName'><font color='red'>*</font>Number of Clients (Running bacula-fd):</td>
524 <td class='ItemValue'>
525 <input type='text' class='ItemValue' id='number_fd' name='number_fd'
526 size='5' maxlength='10' value=''></td>
529 <tr><td class='ItemName'>
530 <font color='red'>*</font>Number of Storage Daemons (Running bacula-sd):</td>
531 <td class='ItemValue'>
532 <input type='text' class='ItemValue' id='number_sd' name='number_sd' size='5'
533 maxlength='10' value=''></td>
536 <tr><td class='ItemName' title="See bellow how to get this information"><font color='red'>*</font>Total # of GB saved every month:</td>
537 <td class='ItemValue'><input type='text' class='ItemValue' name='month_gb' size='5'
538 id='month_gb' maxlength='10' value=''></td>
541 <tr><td class='ItemName' title='See bellow how to get this information'><font color='red'>*</font>Number # of Files:</td>
542 <td class='ItemValue'><input type='text' class='ItemValue' name='number_files'
543 id='number_files' size='10' maxlength='15' value=''></td>
547 <td class='ItemName'>Need professional support:</td>
548 <td class='ItemValue'>
549 <select name='support' class='ItemValue'>
550 <option id='support_0' value='0' SELECTED>No
551 <option id='support_1' value='1'>Yes
555 <tr><td colspan=4><br></td></tr>
557 <tr><td class='ItemName' valign='top'>Applicable Hardware and Network Information:</td>
558 <td class='ItemValue' colspan='3'>
559 <textarea name='hardware_comments' wrap='virtual' rows='4' id='hardware_comments'
560 cols='60' class='ItemValue'>Loader Description:
561 Barcode Reader: Yes/No
562 Number of Storage Elements:
563 Number of Import/Export Elements:
570 <tr><td class='ItemName' valign='top'>General Comments:</td>
571 <td class='ItemValue' colspan='3'>
572 <textarea name='comments' id='comments' wrap='virtual' rows='4' cols='60'
573 class='ItemValue'></textarea></tr>
577 if ($_REQUEST['action'] == 'Modify') {
578 echo "<input type='hidden' title='testimonial id' id='id' name='id' class='ItemValue' value=''>";
579 echo "<input type='submit' name='action' class='ItemValue' onclick='return validate_testimonial();' value='Save'>";
580 echo "<input type='submit' name='action' class='ItemValue' onclick='confirm(\"Are you sure ?\");' value='Delete'><br>";
581 echo "<input type='hidden' name='page' class='ItemValue' value='testimonial'><br>";
584 echo "<input type='submit' name='action' class='ItemValue' onclick='return validate_testimonial(this);' value='Review Profile Submission'>";
597 <h3 style="padding: 5px; border-bottom: 1px dotted #002244"> Getting backup information </h3>
598 To get <i>Total # of GB saved every month</i>, you can run this query on you catalog (just adapt the starttime condition and round the result)
600 bacula@yourdir:~$ bconsole
602 SELECT sum(JobBytes)/1073741824 FROM Job WHERE StartTime > '2008-02-07' AND Type = 'B'
605 To know how many files are in your catalog, you can run this:
607 bacula@yourdir:~$ bconsole
609 SELECT sum(JobFiles) FROM Job WHERE Type = 'B'
615 <h3 style="padding: 5px; border-bottom: 1px dotted #002244"> Privacy Notice </h3>
617 The following information is required, but you may choose to not have it
618 published for public viewing if you wish: contact name, email address,
619 organization name. We may use this information to verify the data you submit if
628 if ($_REQUEST['action'] == 'Modify') {
629 $filename = get_file_from_id();
635 $formul = load_formul($filename);
637 echo "<script type='text/javascript' language='JavaScript'>\n";
638 $attribs = array('contact_name','email_address', 'org_name','title','website',
639 'month_gb','number_files', 'number_dir','number_fd','number_sd',
641 foreach ($attribs as $arr) {
642 form_set_value($formul, $arr);
645 $attribs = array('publish_contact','publish_email', 'publish_orgname', 'orgtype_id',
646 'orgindustry_id', 'publish_orgsize','publish_website', 'bacula_version',
647 'country_id','ostype_id', 'redundant_setup', 'catalog_id', 'support');
648 foreach ($attribs as $arr) {
649 form_set_selection($formul, $arr);
652 $attribs = array('comments', 'hardware_comments');
653 foreach ($attribs as $arr) {
654 form_set_text($formul, $arr);
660 } elseif ($_REQUEST['action'] == 'Review Profile Submission') {
662 $form = get_formul();
664 echo "Sorry, something is missing, I can't accept your submission";
666 $token = uniqid(md5(rand()), true);
667 $filename = "$dat_dir/profile.$token";
669 $form['filename'] = $filename;
670 $form['id'] = $token;
674 send_email($form['id'], $form['contact_name'], $form['email_address']);
675 echo "You can modify your profile <a href='?page=testimonial&action=Modify&id=" . $form['id'] . "'>here</a> (keep this link as bookmark)<br><br>";
679 } elseif ($_REQUEST['action'] == 'View') {
681 $file = get_file_from_id();
684 print_formul_file($filename,true);
687 } elseif ($_REQUEST['action'] == 'Delete') {
689 $filename = get_file_from_id();
695 $form = load_formul($filename);
697 if ($form['org_logo'] && file_exists($form['org_logo'])) {
698 rename($upload_dir + $form['org_logo'], 'removed.' + $upload_dir + $form['org_logo']);
700 if (file_exists($filename)) {
701 rename($filename, "$filename-removed");
702 echo "Profile deleted";
705 } elseif ($_REQUEST['action'] == 'Accept' && is_admin()) {
707 $filename = get_file_from_id();
713 $form = load_formul($filename);
715 $hide = $_REQUEST['hide'];
723 echo $form['id'] . " is now " . ($hide?"un":"") . "visible";
726 } elseif ($_REQUEST['action'] == 'Save') {
728 $filename = get_file_from_id();
734 $form = get_formul();
736 $form['filename'] = $filename;
737 $form['id'] = $_REQUEST['id']; // id is clean
738 // $form['visible'] = false;
740 if (!$form['org_logo']) {
741 $form_old = load_formul($filename);
742 $form['org_logo'] = $form_old['org_logo'];
747 echo "Your profile has been modified.<br>";
750 } elseif ($_REQUEST['action'] == 'Admin' && is_admin()) {
754 } elseif (!$_REQUEST['action'] || $_REQUEST['action'] == 'ViewAll') {
756 echo "<a href='?page=testimonial&action=Add'>Add your testimonial</a><br><br>";
759 } elseif ($_REQUEST['action'] == 'AdminExport' && is_admin()) {
761 $file = get_file_from_id();
765 $form = load_formul($file);
769 } elseif ($_REQUEST['action'] == 'sql') {
780 $limit = $_REQUEST['limit'];
781 $offset = $_REQUEST['offset'];
783 $limit = is_numeric($limit)?$limit:5;
784 $offset = is_numeric($offset)?$offset:0;
785 $max = $offset + $limit;
788 if ($limit > 20) { $limit = 20 ;}
790 if ($handle = opendir($dat_dir)) {
791 /* Ceci est la facon correcte de traverser un dossier. */
793 while (false !== ($file = readdir($handle))) {
794 if (preg_match("/^profile.[a-z0-9\.]+$/", $file)) {
795 if (($i >= $offset) && ($i < $max)) {
796 $i += print_formul_file("$dat_dir/$file",$admin);
808 $offset = $offset - $limit;
812 echo "<a href='?page=testimonial&offset=$offset&limit=$limit$password'>Prev</a> ";
815 $offset = $offset + $limit;
816 echo " <a href='?page=testimonial&offset=$offset&limit=$limit$password'>Next</a><br>";
820 function export_form($formul)
822 global $country_lst, $org_type_lst, $org_industry_lst, $os_lst, $catalog_lst, $version_lst;
824 $attribs = array('contact_name','email_address', 'org_name','title','website',
825 'hardware_comments','comments',
826 'publish_contact','publish_email', 'publish_orgname','org_size','redundant_setup',
827 'date','visible', 'support','number_dir',
828 'number_fd','number_sd','month_gb','number_files','publish_orgsize','publish_website');
830 foreach ($attribs as $arr) {
831 print "$arr = " . $formul[$arr] . "\n";
834 print "orgtype = " . $org_type_lst[$formul['orgtype_id']] . "\n";
835 print "orgindustry = " . $org_industry_lst[$formul['orgindustry_id']] . "\n";
836 print "bacula_version = " . $version_lst[$formul['bacula_version']] . "\n";
837 print "country = " . $country_lst[$formul['country_id']] . "\n";
838 print "ostype = " . $os_lst[$formul['ostype_id']] . "\n";
839 print "catalog = " . $catalog_lst[$formul['catalog_id']] . "\n";
844 function get_file_from_id()
847 $id = $_REQUEST['id'];
849 if (!ereg('^[a-zA-Z0-9\.]+$',$id)) {
853 $filename="$dat_dir/profile.$id";
855 if (!file_exists($filename)) {
856 echo "Can't verify your id";
863 function send_email($id, $name, $email)
865 // Your email address
866 // $from = 'kern@sibbald.com';
867 $from = 'eric@eb.homelinux.org';
870 $subject = "[BACULA] New testimonial";
874 You can modify your new testimonial at http://www.bacula.org/en/?page=testimonial&action=Modify&id=$id
879 mail($email, $subject, $message, "From: Bacula WebMaster <$from>");
882 You can review this testimonial at http://www.bacula.org/en/?page=testimonial&action=Modify&id=$id
888 mail('testimonial@baculasystems.com', $subject, $message, "From: $name <$email>");
890 echo "The email has been sent for approval.<br/>";
893 function save_formul($form)
895 $fp = fopen($form['filename'], 'w');
896 fwrite($fp, serialize($form));
900 function get_formul()
905 $attribs = array('contact_name','email_address', 'org_name');
906 foreach ($attribs as $arr) {
907 if (!$_REQUEST[$arr]) {
908 echo "Can't get $arr<br/>";
911 $formul[$arr] = preg_replace('/[^a-zA-Z0-9!\.?\:\/,;_()@\n -]/', " ", $_REQUEST[$arr]);
914 $attribs = array('title','website','hardware_comments','comments') ;
915 foreach ($attribs as $arr) {
916 $formul[$arr] = preg_replace('/[^a-zA-Z0-9!\.?\:\/,;_()@\n -]/', " ", $_REQUEST[$arr]);
918 /* Disallow http:// links into comments field */
920 preg_match('/http:\/\//', $_REQUEST['comments'], $m);
921 if (sizeof($m) > 2) {
925 preg_match('/http:\/\//', $_REQUEST['hardware_comments'], $m);
926 if (sizeof($m) > 2) {
929 /* Disallow when number of dir too big or > number of fd */
930 if (intval($_REQUEST['number_dir']) > 100 ||
931 intval($_REQUEST['number_dir']) > intval($_REQUEST['number_fd'])) {
934 $attribs = array('publish_contact','publish_email', 'publish_orgname', 'orgtype_id',
935 'orgindustry_id','org_size', 'publish_orgsize','publish_website', 'bacula_version',
936 'country_id','ostype_id', 'redundant_setup','number_fd','number_sd','support',
937 'month_gb','number_files','catalog_id','number_dir');
938 foreach ($attribs as $arr) {
939 $tmp = $_REQUEST[$arr];
940 $tmp = preg_replace("/[,\.]/", "", $tmp);
941 if (preg_match("/^[0-9]+$/", $tmp)) {
942 $formul[$arr] = $_REQUEST[$arr];
946 $attribs = array('orgtype_id', 'orgindustry_id', 'org_size', 'country_id','bacula_version',
947 'catalog_id', 'ostype_id','number_fd','number_sd', 'number_dir', 'month_gb','number_files');
948 foreach ($attribs as $arr) {
949 if (!$formul[$arr]) {
950 echo "Can't get $arr<br/>";
955 if ($_FILES['org_logo']) {
956 $token = uniqid(md5(rand()), true);
957 $image = "/upload/$token";
959 if (preg_match("/(jpg|jpeg)$/i", $_FILES['org_logo']['name'])) {
960 $image = "$image.jpg";
961 } elseif (preg_match("/png$/i", $_FILES['org_logo']['name'])) {
962 $image = "$image.png";
963 } elseif (preg_match("/gif$/i", $_FILES['org_logo']['name'])) {
964 $image = "$image.gif";
969 $ret=move_uploaded_file($_FILES['org_logo']['tmp_name'], "$upload_dir/$image");
970 $formul['org_logo'] = $image;
973 $formul['date'] = time();
974 $formul['visible'] = false;
979 function form_set_value($formul,$val)
981 echo "document.getElementById('$val').value = '" . $formul[$val] . "';\n";
984 function form_set_selection($formul,$val)
986 echo "document.getElementById('${val}_" . $formul[$val] . "').selected =true;\n";
989 function form_set_text($formul,$val)
991 $temp = $formul[$val];
992 $temp = str_replace(array("\n", "\r"), array("\\n",""), $temp);
993 echo "document.getElementById('$val').value='" . $temp . "';\n";
996 // passwd file must exist in dat directory
1000 $id = $_REQUEST['p'];
1006 if (!ereg('^[a-zA-Z]+$',$id)) {
1010 if (file_exists("$dat_dir/$id")) {
1017 function admin_link()
1021 $pass = $_REQUEST['p'];
1022 $waiting = $_REQUEST['waiting'];
1023 $password = "&p=$pass";
1026 print "<a href='?page=testimonial&action=Admin$password'> View all</a><br>";
1028 print "<a href='?page=testimonial&action=Admin$password'> View all</a> | ";
1029 print "<a href='?page=testimonial&action=Admin&waiting=1$password'> View Waiting</a><br>";
1035 function load_formul($filename)
1037 if (!file_exists($filename)) {
1041 if (!filesize($filename) || filesize($filename) > 10*1024*1024) {
1044 $fp = fopen($filename, 'r');
1045 $contents = fread ($fp, filesize ($filename));
1048 $formul = unserialize($contents);
1049 if (!is_array($formul)) {
1056 function print_formul_file($filename, $admin) {
1058 $form = load_formul($filename);
1064 if (!$form['visible']) {
1068 $waiting = $_REQUEST['waiting'];
1069 if ($admin && $waiting && $form['visible']) {
1073 $ret = print_formul($form);
1075 if ($form['visible']) {
1076 print "<a href=\"?page=testimonial&action=Accept&hide=1$password&id=" . $form['id'] . "\"> Hide </a> | \n";
1078 print "<a href=\"?page=testimonial&action=Accept$password&id=" . $form['id'] . "\"> Accept </a> | \n";
1080 print "<a href=\"?page=testimonial&action=Modify$password&id=" . $form['id'] . "\"> Modify </a> | \n";
1081 print "<a href=\"?page=testimonial&action=AdminExport$password&id=" . $form['id'] . "\"> Export </a><br><br>\n";
1088 global $dat_dir, $country_lst, $org_type_lst, $org_industry_lst, $os_lst,$catalog_lst, $version_lst;
1093 CREATE TABLE dict (lang text, id int, name text, primary key (lang, id));
1094 CREATE TABLE testimonials (
1098 title text DEFAULT '',
1099 website text DEFAULT '',
1100 filename text DEFAULT '',
1101 month_gb int DEFAULT 0,
1102 number_files bigint DEFAULT 0,
1103 number_dir int DEFAULT 0,
1104 number_fd int DEFAULT 0,
1105 number_sd int DEFAULT 0,
1106 org_size int DEFAULT 0,
1117 publish_contact int DEFAULT 0,
1118 publish_email int DEFAULT 0,
1119 publish_website int DEFAULT 0,
1120 publish_orgname int DEFAULT 0,
1121 publish_orgsize int DEFAULT 0,
1122 redundant_setup int DEFAULT 0,
1123 support int DEFAULT 0,
1124 comments text DEFAULT '',
1125 hardware_comments text DEFAULT '',
1126 visible int DEFAULT 0,
1127 org_logo text DEFAULT '',
1129 lastmodifed int DEFAULT 0
1132 CREATE VIEW reference AS SELECT contact_name,email_address,org_name,title,website,hardware_comments,comments,
1133 publish_contact,publish_email,publish_orgname,org_size,publish_orgsize,publish_website,
1134 redundant_setup,number_fd,number_sd,support,month_gb,number_files,number_dir,date,visible,filename,t.id,
1135 orgtype.name AS orgtype,
1136 orgindustry.name AS orgindustry,
1137 version.name AS bacula_version,
1138 country.name AS country,
1139 ostype.name AS ostype,
1140 catalog.name AS catalog
1141 FROM testimonials AS t, dict AS orgtype, dict AS orgindustry, dict AS version, dict AS country, dict AS ostype,
1144 WHERE t.orgtype_id = orgtype.id AND orgtype.lang = 'en'
1145 AND t.orgindustry_id = orgindustry.id AND orgindustry.lang = 'en'
1146 AND t.bacula_version = version.id AND version.lang = 'en'
1147 AND t.country_id = country.id AND country.lang = 'en'
1148 AND t.ostype_id = ostype.id AND ostype.lang = 'en'
1149 AND t.catalog_id = catalog.id AND catalog.lang = 'en';
1152 INSERT INTO dict (lang, id, name) VALUES ('en', 0, 'no');
1153 INSERT INTO dict (lang, id, name) VALUES ('en', 1, 'yes');
1155 $a = array($version_lst, $country_lst, $org_type_lst, $org_industry_lst, $os_lst,$catalog_lst);
1156 foreach ($a as $tab) {
1157 while(list ($key, $val) = each ($tab))
1159 if ($key != 'empty') {
1160 echo "INSERT INTO dict (lang, id, name) VALUES ('en', $key, '$val');\n";
1164 if ($handle = opendir($dat_dir)) {
1165 /* Ceci est la facon correcte de traverser un dossier. */
1166 while (false !== ($file = readdir($handle))) {
1167 if (preg_match("/^profile.[a-z0-9\.]+$/", $file)) {
1170 $form = load_formul("$dat_dir/$file");
1171 while(list ($key, $val) = each ($form))
1173 array_push($tmpv, "'$val'");
1174 array_push($tmpk, $key);
1176 echo "INSERT INTO testimonials (";
1177 print join(",", $tmpk);
1179 print join(",", $tmpv);
1187 function print_formul($formul)
1189 global $country_lst, $org_type_lst, $org_industry_lst, $os_lst,$catalog_lst;
1194 <b><? echo ($formul['publish_orgname'])?$formul['org_name']:'N/A' ?></b><br>
1196 <tr><td> Date: </td><td><? echo date('d/m/o', $formul['date']) ?> </td></tr>
1197 <tr><td> Location: </td><td><? $a = $formul['country_id'] ; echo $country_lst[$a] ?> </td></tr>
1198 <tr><td> Organization Type: </td><td><? echo $org_type_lst[$formul['orgtype_id']] ?> </td></tr>
1199 <tr><td> Industry/Function: </td><td><? echo $org_industry_lst[$formul['orgindustry_id']] ?> </td></tr>
1201 <? if ($formul['publish_orgsize']) { ?>
1202 <tr><td> Organisation Size: </td><td><? echo $formul['org_size'] ?> </td></tr>
1205 <? if ($formul['publish_website']) { ?>
1206 <tr><td> Website: </td><td><a href="<? echo $formul['website'] ?>"><? echo $formul['website'] ?></a></td></tr>
1209 <? if ($formul['number_fd'] > 1) { ?>
1210 <tr><td> Number of fd: </td><td><? echo $formul['number_fd'] ?> </td></tr>
1213 <? if ($formul['month_gb'] > 1) { ?>
1214 <tr><td> GB/Month: </td><td><? echo $formul['month_gb'] ?> </td></tr>
1217 <tr><td> Comments: </td><td width='650'><i><? echo $formul['comments'] ?> </i></td></tr>
1218 <? if ($formul['publish_contact']) { ?>
1219 <tr align='right'><td></td><td><i><? echo $formul['contact_name'] ?> </i></td></tr>
1227 <? if ($formul['org_logo']) { ?>
1228 <a href="<? echo $formul['org_logo'] ?>" ><img width='150' src="<? echo $formul['org_logo'] ?>"></a>
1231 </tr> <!-- added -->
1238 <? require_once("inc/footer.php"); ?>