This repository has been archived by the owner on Mar 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsurvey-press.php
721 lines (593 loc) · 28.7 KB
/
survey-press.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
<?php
/* Copyright 2012 Shubham Sachdeva (email : [email protected])
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
Author: Shubham Sachdeva
Plugin Name: SurveyPress
Plugin URI: http://wordpress.org/extend/plugins/surveypress/
Description: <strong>LimeSurvey + WordPress = A perfect combination of blog fully capable of managing surveys</strong>. Using this plugin, you can integrate LimeSurvey with WordPress to make registered users take surveys. Allow them to make their own survey(s) and so on.
Version: 1.0.9
Author URI: http://docs.limesurvey.org/UserPage+magiclko
License: GPLv2
*/
// Make sure we don't expose any info if called directly
if ( !function_exists( 'add_action' ) ) {
echo _e("Hi there! I'm just a plugin, not much I can do when called directly.");
exit;
}
define('_PLUGIN_NAME_', 'SurveyPress');
define('_PLUGIN_VERSION_', '1.0.9!');
define('_PLUGIN_URL_', plugin_dir_url( __FILE__ ));
/**
* Global variables assosciated with config screen
*/
// variables for the top menu content.
$db_option_name = 'db_name';
$db_option_user = 'db_user';
$db_option_host = 'db_host';
$db_option_pwd = 'db_pwd';
$db_option_prefix = 'db_prefix';
$db_option_url = 'ls_base_url';
// respective values from database.
// Read in existing option value from database
$db_value_name = get_option( $db_option_name );
$db_value_user = get_option( $db_option_user );
$db_value_host = get_option( $db_option_host );
$db_value_pwd = get_option( $db_option_pwd );
$db_value_prefix = get_option( $db_option_prefix );
$db_value_url = get_option( $db_option_url );
/**
* Global variables assosciated with tokens screen
*/
// variables for the option menu content.
$option_token_basis = 'token_basis';
$option_token_uses = 'token_uses';
$token_option_sid_list = 'token_sid_list';
// respective values from database.
// Read in existing option value from database
$token_value_sid_list = get_option( $token_option_sid_list );
$value_token_uses = get_option( $option_token_uses );
if ( $value_token_uses != '' )
{
$value_token_uses = (int) $value_token_uses;
}
if ( get_option( $option_token_basis ) == '' )
{
$value_token_basis = 1;
}
else
{
$value_token_basis = (int) get_option( $option_token_basis );
}
$map_role_subscriber_token = (int) get_option( 'map_role_subscriber_token' );
$map_role_administrator_token = (int) get_option( 'map_role_administrator_token' );
$map_role_editor_token = (int) get_option( 'map_role_editor_token' );
$map_role_author_token = (int) get_option( 'map_role_author_token' );
$map_role_contributor_token = (int) get_option( 'map_role_contributor_token' );
/**
* Global variables assosciated with option screen
*/
// variables for the option menu content.
$apply_option_default_permissions = 'apply_default_permissions';
$show_option_survey_notification = 'show_survey_notification';
$show_option_import_users = 'import_users';
$same_option_password = 'same_password';
$list_option_public_surveys = 'list_public_survey_only';
// respective values from database.
// Read in existing option value from database
if ( get_option( $apply_option_default_permissions ) == '' )
{
$apply_value_default_permissions = 1;
}
else
{
$apply_value_default_permissions = (int) get_option( $apply_option_default_permissions );
}
if ( get_option( $show_option_survey_notification ) == '' )
{
$show_value_survey_notification = 1;
}
else
{
$show_value_survey_notification = (int) get_option( $show_option_survey_notification );
}
if ( get_option( $show_option_import_users ) == '' )
{
$show_value_import_users = 1;
}
else
{
$show_value_import_users = (int) get_option( $show_option_import_users );
}
if ( get_option( $same_option_password ) == '' )
{
$same_value_password = 1;
}
else
{
$same_value_password = (int) get_option( $same_option_password );
}
if ( get_option( $list_option_public_surveys ) == '' )
{
$list_value_public_surveys = 1;
}
else
{
$list_value_public_surveys = (int) get_option( $list_option_public_surveys );
}
/**
* Global variables assosciated with mapping screen
*/
// Read in existing mapping value from database
$map_role_subscriber_create_survey = (int) get_option( 'map_role_subscriber_create_survey' );
$map_role_subscriber_config = (int) get_option( 'map_role_subscriber_config' );
$map_role_subscriber_create_user = (int) get_option( 'map_role_subscriber_create_user' );
$map_role_subscriber_del_user = (int) get_option( 'map_role_subscriber_del_user' );
$map_role_subscriber_manage_template = (int) get_option( 'map_role_subscriber_manage_template' );
$map_role_subscriber_manage_label = (int) get_option( 'map_role_subscriber_manage_label' );
$map_role_administrator_create_survey = (int) get_option( 'map_role_administrator_create_survey' );
$map_role_administrator_config = (int) get_option( 'map_role_administrator_config' );
$map_role_administrator_create_user = (int) get_option( 'map_role_administrator_create_user' );
$map_role_administrator_del_user = (int) get_option( 'map_role_administrator_del_user' );
$map_role_administrator_manage_template = (int) get_option( 'map_role_administrator_manage_template' );
$map_role_administrator_manage_label = (int) get_option( 'map_role_administrator_manage_label' );
$map_role_editor_create_survey = (int) get_option( 'map_role_editor_create_survey' );
$map_role_editorr_config = (int) get_option( 'map_role_editor_config' );
$map_role_editor_create_user = (int) get_option( 'map_role_editor_create_user' );
$map_role_editor_del_user = (int) get_option( 'map_role_editor_del_user' );
$map_role_editor_manage_template = (int) get_option( 'map_role_editor_manage_template' );
$map_role_editor_manage_label = (int) get_option( 'map_role_editor_manage_label' );
$map_role_author_create_survey = (int) get_option( 'map_role_author_create_survey' );
$map_role_author_config = (int) get_option( 'map_role_author_config' );
$map_role_author_create_user = (int) get_option( 'map_role_author_create_user' );
$map_role_author_del_user = (int) get_option( 'map_role_author_del_user' );
$map_role_author_manage_template = (int) get_option( 'map_role_author_manage_template' );
$map_role_author_manage_label = (int) get_option( 'map_role_author_manage_label' );
$map_role_contributor_create_survey = (int) get_option( 'map_role_contributor_create_survey' );
$map_role_contributor_config = (int) get_option( 'map_role_contributor_config' );
$map_role_contributor_create_user = (int) get_option( 'map_role_contributor_create_user' );
$map_role_contributor_del_user = (int) get_option( 'map_role_contributor_del_user' );
$map_role_contributor_manage_template = (int) get_option( 'map_role_contributor_manage_template' );
$map_role_contributor_manage_label = (int) get_option( 'map_role_contributor_manage_label' );
/**
* Global LimeSurvey database connection variables.
*/
if ( $db_value_user != '' && $db_value_name != '' && $db_value_host != '' )
{
$lsdb = new wpdb( $db_value_user, $db_value_pwd, $db_value_name, $db_value_host );
}
$db_connection_error_name = "db_connection_error";
$db_connection_error = get_option( $db_connection_error_name );
/**
* Bridge_WP_LS
*
* @package SurveyPress
* @author Shubham Sachdeva
* @copyright 2012
* @version 1.0.9
* @access public
*/
class Bridge_WP_LS {
// an - a unique identifier!
/**
* Bridge_WP_LS::an_add_menus()
* adds menu to the dashboard of users/admin.
* @return
*/
function an_add_menus()
{
global $show_value_survey_notification;
$permission = '';
if ((int)$show_value_survey_notification == 1)
{
$permission = 'read';
}
else
{
$permission = 'manage_options';
}
// Add a new top-level menu:
$hook_suffix_top_menu = add_menu_page(__('Bridge WP LS plugin','menu-test'), __('SurveyPress','menu-test'), $permission, 'an-survey-config', array('Bridge_WP_LS', 'an_add_config_menu'));
// Add hook for action executed when plugin's options page is loaded
add_action( 'load-' . $hook_suffix_top_menu , array('Bridge_WP_LS','an_top_menu_loaded') );
// Add a submenu to the custom top-level menu:
//add_submenu_page('an-survey', __('Configure this plugin','menu-test'), __('Configuration','menu-test'), 'manage_options', 'an-bridge-config', array('bridge_wp_ls', 'an_add_menu_1'));
// Add a second submenu to the custom top-level menu:
$hook_suffix_top_menu = add_submenu_page('an-survey-config', __('Bridge WP LS plugin','menu-test'), __('Configuration','menu-test'), $permission, 'an-survey-config');
// Add hook for action executed when plugin's options page is loaded
add_action( 'load-' . $hook_suffix_top_menu , array('Bridge_WP_LS','an_top_menu_loaded') );
// Add a submenu to the custom top-level menu:
add_submenu_page('an-survey-config', __('Map the roles and user permissions','menu-test'), __('Mapping','menu-test'), 'manage_options', 'an-bridge-map',array('Bridge_WP_LS', 'an_add_menu_mapping'));
// Add a submenu to the custom top-level menu:
add_submenu_page('an-survey-config', __('Tokens','menu-test'), __('Tokens','menu-test'), 'manage_options', 'an-bridge-tokens',array('Bridge_WP_LS', 'an_add_menu_tokens'));
// Add a submenu to the custom top-level menu:
add_submenu_page('an-survey-config', __('Customize','menu-test'), __('Customize','menu-test'), 'manage_options', 'an-bridge-opt', array('Bridge_WP_LS', 'an_add_menu_options'));
}
// an_add_top_menu() displays the page content for the custom Test Toplevel menu
/**
* Bridge_WP_LS::an_add_config_menu()
* adds configuration page. It displays configuration options pertaining to LimeSurvey.
* @return
*/
function an_add_config_menu()
{
include 'view/config-menu.php';
}
// an_add_menu_mapping() displays the page content for the first submenu
// of the custom Test Toplevel menu
/**
* Bridge_WP_LS::an_add_menu_mapping()
* adds mapping page. It displays the mapping options between user permissions of LS and capabilities of WP.
* @return
*/
function an_add_menu_mapping()
{
if (!current_user_can('manage_options'))
{
wp_die( __('You do not have sufficient permissions to access this page.') );
}
include 'view/mapping-menu.php';
}
// an_add_top_menu() displays the page content for the custom Test Toplevel menu
/**
* Bridge_WP_LS::an_add_config_menu()
* adds configuration page. It displays configuration options pertaining to LimeSurvey.
* @return
*/
function an_add_menu_tokens()
{
if (!current_user_can('manage_options'))
{
wp_die( __('You do not have sufficient permissions to access this page.') );
}
include 'view/tokens-menu.php';
}
// an_add_menu_options() displays the page content for the second submenu
// of the custom Test Toplevel menu
/**
* Bridge_WP_LS::an_add_menu_options()
* adds Options page. It displays some plugin options, some customization options to admin which control the bahaviour of this plugin.
* @return
*/
function an_add_menu_options()
{
if (!current_user_can('manage_options'))
{
wp_die( __('You do not have sufficient permissions to access this page.') );
}
include 'view/option-menu.php';
}
//called when top lovele menu has been loaded!
/**
* Bridge_WP_LS::an_top_menu_loaded()
* It removes the admin notice of "plugin not being configured" when it's plugin configuraytion page.
* @return
*/
function an_top_menu_loaded()
{
// Current page is options page for our plugin, so do not display notice
// (remove hook responsible for this)
remove_action( 'admin_notices', array( 'Bridge_WP_LS', 'an_add_admin_notice' ) );
}
//this function will output proper notice on administration panel
/**
* Bridge_WP_LS::an_add_admin_notice()
* It displays the admin notice of "plugin not being configired" on every admin page. To remove the admin notice on some specific page, modify an_top_menu_loaded()
* @return
*/
function an_add_admin_notice()
{
if (!current_user_can('manage_options'))
{
return ;
}
$wpurl = get_bloginfo( 'wpurl' );
$pluginurl = $wpurl.'/wp-admin/admin.php?page=an-survey-config'
?>
<div id='notice' class='updated fade'><p>
<?php
echo _e("You haven't configured '<strong><a href='".$pluginurl."' title='SurveyPress' >"._PLUGIN_NAME_."</a></strong>' plugin properly!");
?>
</p></div>
<?php
}
/**
* Bridge_WP_LS::an_insert_into_ls()
* This function import the users from WP to LS.
* @return
*/
function an_insert_into_ls( $username, $password )
{
//global $wpdb,$db_option_user,$db_option_host,$db_option_pwd,$db_option_name;
global $db_value_host,$db_value_name,$db_value_pwd,$db_value_user,$db_value_prefix,$lsdb;
global $apply_value_default_permissions,$same_value_password;
$userinfo = get_user_by( 'login', $username );
//$lsdb = new wpdb( $db_value_user, $db_value_pwd, $db_value_name, $db_value_host );
//switch on sql error is any!
$lsdb->show_errors();
// information required to add users to lsdb
// 1. parent ID
// 2. full name
// 3. username
// 4. password (hashed!)
// 5. email of user
// 6. dbprefix of LS
//parent ID (by default - 0(admin)!)
require_once dirname( __FILE__ ) . '/sha256.php';
$adminusername = 'admin';
$pwd = SHA256::hashing($password);
// Verify whether this record is in LS database or not.
$rows = $lsdb->query( $lsdb->prepare( "SELECT * FROM ".$db_value_prefix."users WHERE users_name = %s AND password = %s", $username, $pwd ) );
if( $rows === 1 )
{
//no need to update, entry already exist there!
return TRUE;
}
else
{
if ( $rows === FALSE )
{
//echo "Query failed!";
return FALSE;
}
else
{
//password has changed in wp, update it in LS or user doesn't yet exist!
$rows = $lsdb->query( $lsdb->prepare( "SELECT uid FROM ".$db_value_prefix."users WHERE users_name = %s", $username ) );
if ( $rows === 0 )
{
//insert query!
$puid = $lsdb->get_var( $lsdb->prepare( "SELECT uid FROM ".$db_value_prefix."users WHERE users_name = '".$adminusername."'" ) );
//echo $userinfo->user_login."--".$userinfo->user_firstname." ".$userinfo->user_lastname."--".$userinfo->user_email."--".$puid;
//exit();
if ( ((int)$apply_value_default_permissions) == 1 )
{
$create_survey = 0 ;
$configurator = 0 ;
$create_user = 0 ;
$del_user = 0 ;
$manage_templates = 0 ;
$manage_labels = 0 ;
}
else
{
if ( !empty( $userinfo->roles ) && is_array( $userinfo->roles ) ) {
/*
foreach ( $userinfo->roles as $role )
echo $role;
*/
$role = $userinfo->roles[0];
} //end inner if
switch ( $role )
{
case "administrator" :
global $map_role_administrator_config,$map_role_administrator_create_survey,$map_role_administrator_del_user;
global $map_role_administrator_manage_label,$map_role_administrator_manage_template,$map_role_administrator_create_user;
$create_survey = $map_role_administrator_create_survey;
$configurator = $map_role_administrator_config;
$create_user = $map_role_administrator_create_user;
$del_user = $map_role_administrator_del_user;
$manage_templates = $map_role_administrator_manage_template;
$manage_labels = $map_role_administrator_manage_label;
break;
case "editor" :
global $map_role_editor_config,$map_role_editor_create_survey,$map_role_editor_del_user;
global $map_role_editor_manage_label,$map_role_editor_manage_template,$map_role_editor_create_user;
$create_survey = $map_role_editor_create_survey;
$configurator = $map_role_editor_config;
$create_user = $map_role_editor_create_user;
$del_user = $map_role_editor_del_user;
$manage_templates = $map_role_editor_manage_template;
$manage_labels = $map_role_editor_manage_label;
break;
case "author" :
global $map_role_author_config,$map_role_author_create_survey,$map_role_author_del_user;
global $map_role_author_manage_label,$map_role_author_manage_template,$map_role_author_create_user;
$create_survey = $map_role_author_create_survey;
$configurator = $map_role_author_config;
$create_user = $map_role_author_create_user;
$del_user = $map_role_author_del_user;
$manage_templates = $map_role_author_manage_template;
$manage_labels = $map_role_author_manage_label;
break;
case "contributor" :
global $map_role_contributor_config,$map_role_contributor_create_survey,$map_role_contributor_del_user;
global $map_role_contributor_manage_label,$map_role_contributor_manage_template,$map_role_contributor_create_user;
$create_survey = $map_role_contributor_create_survey;
$configurator = $map_role_contributor_config;
$create_user = $map_role_contributor_create_user;
$del_user = $map_role_contributor_del_user;
$manage_templates = $map_role_contributor_manage_template;
$manage_labels = $map_role_contributor_manage_label;
break;
case "subscriber" :
global $map_role_subscriber_config,$map_role_subscriber_create_survey,$map_role_subscriber_del_user;
global $map_role_subscriber_manage_label,$map_role_subscriber_manage_template,$map_role_subscriber_create_user;
$create_survey = $map_role_subscriber_create_survey;
$configurator = $map_role_subscriber_config;
$create_user = $map_role_subscriber_create_user;
$del_user = $map_role_subscriber_del_user;
$manage_templates = $map_role_subscriber_manage_template;
$manage_labels = $map_role_subscriber_manage_label;
break;
} //end switch
} ///end outer if-else
$success = $lsdb->insert(
$db_value_prefix.'users',
array(
'users_name' => $userinfo->user_login,
'password' => $pwd,
'full_name' => $userinfo->user_firstname.' '.$userinfo->user_lastname,
'parent_id' => $puid,
'lang' => 'auto',
'email' => $userinfo->user_email,
'create_survey' => $create_survey,
'create_user' => $create_user,
'delete_user' => $del_user,
'superadmin' => 0,
'configurator' => $configurator,
'manage_template' => $manage_templates,
'manage_label' => $manage_labels
),
array(
'%s',
'%s',
'%s',
'%d',
'%s',
'%s',
'%d',
'%d',
'%d',
'%d',
'%d',
'%d',
'%d',
'%d'
)
);
if ( $success )
{
$uid = $lsdb->insert_id;
return $lsdb->insert(
$db_value_prefix.'templates_rights',
array(
'uid' => $uid,
'folder' => 'default',
'use' => 1
),
array(
'%d',
'%s',
'%d'
)
);
}
else
{
return FALSE;
}
//echo "inserting query!";
//return TRUE;
}
else
{
//TODO: Is this the required behaviour?
if ( ((int)$same_value_password) == 1 )
{
//passwords can be different, so no need to update LS password!
return TRUE;
}
//No! password should be same and it should be WP password, let's update it.
if ( $rows === 1 && ( ((int)$same_value_password) == 0 ) )
{
//update query
//BLACKLIST : admin
if ( strcmp($username,'admin') == 0 )
{
return TRUE;
}
return $lsdb->update(
$db_value_prefix.'users',
array(
'password' => $pwd
),
array(
'users_name' => $userinfo->user_login
),
array(
'%s'
),
array(
'%s'
)
);
//echo "updatng query!";
//return TRUE;
}
else
{
//echo "query failed!";
return FALSE;
}
}
}
}
}
/**
* Bridge_WP_LS::an_check_user_authentication()
* This function first authenticate user, then call an_insert_into_ls() to import the user from WP to LS.
* @return
*/
function an_check_user_authentication( $username ) {
global $db_connection_error, $show_value_import_users;
if ( $db_connection_error == TRUE || $show_value_import_users == 0 ) {
return;
}
$username = sanitize_user($username);
if(!username_exists($username)) {
return;
}
//TODO: sanitize it!
$postpwd = $_POST['pwd'];
$postpwd = trim( $postpwd );
$userinfo = wp_authenticate( $username, $postpwd );
if ( is_wp_error( $userinfo ) )
{
echo $userinfo->get_error_message();
return FALSE;
}
if ( ! self::an_insert_into_ls( $username, $postpwd ) )
{
echo "unable to update records in ls table with given credentials!";
exit();
}
}
}
/**
* Hooks
*/
// hook to display config,options,mapping pages at admin/user dashboard!
add_action('admin_menu', array('Bridge_WP_LS', 'an_add_menus'));
//hook to import users from WP to LS.
add_action('wp_authenticate',array('Bridge_WP_LS','an_check_user_authentication'));
/*
Admin Notice Hooks
*/
// add admin notice if any of the configration field is empty or not set!
//TODO: Pass argument and make the notice more specific as to which field is to be filled!
if ( get_option( $db_option_host ) == '' )
{
add_action( 'admin_notices', array('Bridge_WP_LS', 'an_add_admin_notice'));
}
if ( get_option( $db_option_name ) == '' )
{
add_action( 'admin_notices', array('Bridge_WP_LS', 'an_add_admin_notice'));
}
if ( get_option( $db_option_user ) == '' )
{
add_action( 'admin_notices', array('Bridge_WP_LS', 'an_add_admin_notice'));
}
if ( get_option( $db_option_pwd ) == '' )
{
add_action( 'admin_notices', array('Bridge_WP_LS', 'an_add_admin_notice'));
}
if ( get_option( $db_option_prefix ) == '' )
{
add_action( 'admin_notices', array('Bridge_WP_LS', 'an_add_admin_notice'));
}
if ( get_option( $db_option_url ) == '' )
{
add_action( 'admin_notices', array('Bridge_WP_LS', 'an_add_admin_notice'));
}
?>