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