4 * GlobalDashboard plugin
6 * Daniel Perez <danielperez.arg@gmail.com>
8 * This is an example to watch things in action. You can obviously modify things and logic as you see fit
11 require_once '../../env.inc.php';
12 require_once $gfwww.'include/pre.php';
13 require_once $gfplugins.'globaldashboard/include/globalDashboard_utils.php';
15 $user = session_get_user(); // get the session user
17 if (!$user || !is_object($user) || $user->isError() || !$user->isActive()) {
18 exit_error("Invalid User", "Cannot Process your requglobaldashboardest for this user.");
21 $type = getStringFromRequest('type');
22 $id = getStringFromRequest('id');
23 $pluginname = getStringFromRequest('pluginname');
26 exit_error("Cannot Process your request","No TYPE specified"); // you can create items in Base.tab and customize this messages
28 exit_error("Cannot Process your request","No ID specified");
30 if ($type == 'user') {
31 $realuser = user_get_object($id);//
32 if (!($realuser) || !($realuser->usesPlugin($pluginname))) {
33 exit_error("Error", "First activate the User's $pluginname plugin through Account Maintenance Page");
35 if ( (!$user) || ($user->getID() != $id)) { // if someone else tried to access the private GlobalDashboard part of this user
36 exit_error("Access Denied", "You cannot access other user's personal $pluginname");
38 globaldashboard_header(array('title'=> _('Global Dashboard Configuration')));
39 globaldashboard_toolbar();
40 globaldashboard_body();
44 site_project_footer(array());
48 // c-file-style: "bsd"