Esempio n. 1
0
$dropbox->add_value('3', 'three');
$dropbox->print_dropbox('dropdown', $dropdown);
echo '<br /><br />';
//or direct database link:
//this is how you should load a class:
require_once $GO_CONFIG->class_path . 'users.class.inc';
//create a users object:
$users = new users();
//this function gets all users
$users->get_users();
//we can now pass the users object to the dropdown box and add all the users to it
//declare the user var
$user = isset($user) ? $user : '******';
$dropbox = new dropbox();
//add the users class, use 'id' for value and 'name' for text
$dropbox->add_sql_data('users', 'id', 'name');
//print the dropbox
$dropbox->print_dropbox('user', $user);
echo '<br /><br />';
//statusbar control
$statusbar = new statusbar();
$statusbar->info_text = 'Group-Office usage';
$statusbar->turn_red_point = 90;
$statusbar->print_bar(75, 100);
//how do you get user info
//the current user is stored in:
echo 'Your user ID is "' . $GO_SECURITY->user_id . '"<br />';
$user = $users->get_user($GO_SECURITY->user_id);
echo 'Your name is "' . $user['name'] . '"<br /><br />';
//now for some permission management.
//You can secure an object by giving it an ACL (Access Control List). When the user
Esempio n. 2
0
     $dropbox = new dropbox();
     $dropbox->add_value('1', 'one');
     $dropbox->add_value('2', 'two');
     $dropbox->add_value('3', 'three');
     $dropbox->print_dropbox('dropdown', $dropdown);
     echo '<br /><br />';
     //or direct database link:
     //this is how you should load a class:
     //this function gets all users
     $GO_USERS->get_users();
     //we can now pass the users object to the dropdown box and add all the users to it
     //declare the user var
     $user = isset($_POST['user']) ? $_POST['user'] : '******';
     $dropbox = new dropbox();
     //add the users class, use 'id' for value and 'name' for text
     $dropbox->add_sql_data('GO_USERS', 'id', 'first_name');
     //print the dropbox
     $dropbox->print_dropbox('user', $user);
     echo '<br /><br />';
     //statusbar control
     $statusbar = new statusbar();
     $statusbar->info_text = 'Group-Office usage';
     $statusbar->turn_red_point = 90;
     $statusbar->print_bar(75, 100);
     break;
 case 'acl_demo':
     //You can secure an object by giving it an ACL (Access Control List). When the user
     //you logged in with was created it also got an ACL. This acl is used to protect your personal profile.
     //We already got the user information in the above example so the user acl = stored in $user['acl_id'].
     //So if we want to set the permissions this can be done really easily with the acl control
     echo '<p>You are visible to:</p>';
Esempio n. 3
0
 //echo '<input type="hidden" name="seperator" value="'.$seperator.'">';
 echo '<input type="hidden" name="import_type" value="' . $_POST['import_type'] . '">';
 if (isset($feedback)) {
     echo $feedback;
 }
 echo $contacts_import_feedback . '<br /><br />';
 if ($_POST['import_type'] == 'contacts') {
     echo '<table border="0" cellpadding="2" cellspacing="0">';
     $group_mode = isset($_POST['group_mode']) ? $_POST['group_mode'] : 'group_name';
     if ($ab->get_groups($addressbook_id) > 0) {
         $check = $group_mode == 'group_name' ? 'checked' : '';
         echo '<tr><td><input type="radio" name="group_mode" value="group_name" ' . $check . ' />' . $contacts_import_to_group . ': </td><td>';
         $group_id = isset($_POST['group_id']) ? $_POST['group_id'] : 0;
         $dropbox = new dropbox();
         $dropbox->add_value('0', $contacts_other);
         $dropbox->add_sql_data('ab', 'id', 'name');
         $dropbox->print_dropbox('group_id', $group_id);
         echo '</td></tr>';
         $check = $group_mode == 'file' ? 'checked' : '';
         echo '<tr><td><input type="radio" name="group_mode" value="file" ' . $check . '  />' . $contacts_auto_group . ': </td><td>';
     } else {
         $check = $group_mode == 'file' ? true : false;
         echo '<tr><td><input type="hidden" name="group_id" value="0" />';
         $checkbox = new checkbox('group_mode', 'file', $ab_group_on_file, $check);
         echo ':</td><td>';
     }
     $dropbox = new dropbox();
     for ($n = 0; $n < sizeof($record); $n++) {
         $dropbox->add_value($n, $record[$n]);
     }
     $group_record = isset($_POST['group_record']) ? $_POST['group_record'] : 0;