Example #1
0
$website_title = $GLOBALS['s3db_info']['server']['site_title'] . ' - access log';
$site_intro = $GLOBALS['s3db_info']['server']['site_intro'];
$manager = 'Access Log';
$content_width = '80%';
$s3ql = compact('user_id', 'db');
$s3ql['select'] = '*';
$s3ql['from'] = 'accesslog';
if ($_REQUEST['orderBy'] != '') {
    $s3ql['order_by'] = $_REQUEST['orderBy'] . ' ' . $_REQUEST['direction'];
} else {
    $s3ql['order_by'] = 'login_timestamp desc';
}
$logs = S3QLaction($s3ql);
#echo '<pre>';print_r($logs);exit;
if (count($logs) > 0) {
    $data_grid = render_elements($logs, '', array('Login ID', 'Login From', 'Login Time'), 'accesslog');
}
include S3DB_SERVER_ROOT . '/s3style.php';
include S3DB_SERVER_ROOT . '/tabs.php';
?>
<!-- BEGIN top -->

<table class="top" align="center">
	<tr><td>
		<table class="insidecontents" align="center" width="<?php 
echo $content_width;
?>
">
			<tr><td class="message"><br /><?php 
echo $message;
?>
Example #2
0
    #$project_actions .= '<input type="button" value="Export Project in RDF" size="20" onClick="window.location=\''.$action['rdfexport'].'\'">&nbsp;&nbsp;&nbsp;';
    $project_actions .= '<input type="button" value="RDF" size="20" onClick="window.open(\'' . $action['rdfmenu'] . '\',null,\'height=350,width=400,resizable=1,scrollbars=1\')">&nbsp;&nbsp;&nbsp;';
    $project_actions .= '<BR></TABLE></center>';
    echo '<table  border=0 class="intro" width="100%"  align="center">
		<tr  bgcolor="#99CCFF"><td  colspan="3" align="center"><FONT Face="Arial" SIZE="3" COLOR="navy">Export</td></tr>';
    echo '<tr><td>' . $project_actions . '</tr></td>';
    #Find all the users involved in the project
    #$P = compact('db', 'user_id', 'project_id', 'sortorder', 'direction');
    #$shared_users = list_project_users($P);
    #$shared_users = list_shared_users($uni);
    if (is_array($_SESSION[$user_id]['users'][$project_id])) {
        $shared_users = $_SESSION[$user_id]['users'][$project_id];
    } else {
        $s3ql = compact('user_id', 'db');
        $s3ql['select'] = '*';
        $s3ql['from'] = 'users';
        $s3ql['where']['project_id'] = $project_id;
        if ($_REQUEST['orderBy'] != '') {
            $s3ql['order_by'] = $_REQUEST['orderBy'] . ' ' . $_REQUEST['direction'];
        }
        $shared_users = S3QLaction($s3ql);
        #$_SESSION[$user_id]['users'][$project_id] = $shared_users;
    }
    #increment with the owner and the user that is visualizing the project
    if (is_array($shared_users) && !empty($shared_users)) {
        echo '<table  border=0 class="intro" width="100%"  align="center">
			<tr  bgcolor="#99CCFF"><td  colspan="3" align="center"><FONT Face="Arial" SIZE="3" COLOR="navy">Users</td></tr>';
        echo render_elements($shared_users, $acl, array('Login', 'User Name', 'Permissions'), 'account_acl');
    }
}
include 'footer.php';
Example #3
0
		<?php 
    echo '<td><b>' . $class_id . '</b></td>';
    ?>
	</tr>
	<tr class="">
	<td>
	<BR>
	<?php 
    if ($project_info['add_data']) {
        echo '<input type="button" value="Edit Rules" size="20" onClick="window.location=\'' . $action['editrules'] . '\'">&nbsp;&nbsp;&nbsp;<BR><BR> </td>';
    }
    ?>
	<td><BR></td>
	</tr>


<?php 
    #include the rules at the end of the page
    #echo '<pre>';print_r($rules);
    if (is_array($rules) && !empty($rules)) {
        echo '<tr bgcolor="#CCFF99"><td colspan="3" align="center">Rules</td></tr>';
        echo $rule_list = render_elements($rules, $acl, array('Rule_id', 'Subject', 'Verb', 'Object', 'Notes'), 'rule');
    }
    if (is_array($users) && !empty($users)) {
        echo '<BR><BR>';
        echo '<table  border=0 class="intro" width="100%"  align="center"><tr bgcolor="#CCFF99"><td colspan="3" align="center">Users</td></tr>';
        echo $user_list = render_elements($users, $acl, array('Login', 'User Name', 'Permissions'), 'account_acl');
    }
}
?>
</table>
Example #4
0
    if ($found_project) {
        echo 'This project is being accessed.';
    } else {
        #When the creator is not revealed, use the local user as the owner of the project
        #	if ($creator=='' || $creator = 'anonymous') $creator = $_SESSION['user']['account_id'];
        #$newproject = array ('project_id'=>$_POST['remote_project_id'], 'project_name'=>$title, 'project_description'=>$description,'created_on'=>$date, 'created_by'=>$date, 'key'=>$_POST['key'], 'URI'=>$_POST['URI'], 'project_status' =>$status);
        #$inserted_project = insert_project($newproject);
    }
}
if (is_array($projects) && !empty($projects)) {
    $projects = replace_created_by($projects, $db);
    #$projects = include_acl($projects, $user_id, $db);
    echo '<table class="insidecontents" width="80%" align="center">
		<tr><td class="message">' . $message . '</td></tr>
		<tr bgcolor="#99CCFF"><td align="center">Project Manager</td></tr><tr><td>';
    echo render_elements($projects, $acl, array('Project ID', 'Project Name', 'Project Description', 'Owner', 'Actions'), 'project');
}
include '../S3DBjavascript.php';
?>

</table>
<table width="80%" align="center">
	<tr><td>
	<table class="insidecontents" width="80%" align="center">
	</td></tr>
	<tr><td align="left">
	<?php 
if ($user_info['account_type'] == 'p') {
    $disabled = " disabled";
}
echo '<input type="button" name="newproject" value="New Project" onclick="window.location=\'' . $action['createproject'] . '\'"' . $disabled . '>';
Example #5
0
$s3ql['from'] = 'keys';
if ($_REQUEST['orderBy'] != '') {
    $s3ql['order_by'] = $_REQUEST['orderBy'] . ' ' . $_REQUEST['direction'];
}
#echo '<pre>';print_r($s3ql);
$user_keys = S3QLaction($s3ql);
#echo '<pre>';print_r($user_keys);exit;
#Create the table with exsiting keys
#Parse to the template
$add_key_form = $create_key_line;
if (is_array($user_keys) && !empty($user_keys)) {
    $existing_keys_header = "<tr bgcolor='#80BBFF'><td colspan='9' align='center'>Existing Keys</td></b></tr><td><BR></td>";
    $columns = array('Key', 'Requested By', 'Expires', 'Notes', 'Actions');
    #echo '<pre>';print_r($user_keys);
    $user_keys = replace_created_by($user_keys, $db);
    $keys_table = render_elements($user_keys, $acl, $columns, 'access_keys');
}
?>
<table class="contents">
	<table class="top" align="center">
	<tr><td>
		<table class="insidecontents" align="center" width="<?php 
echo $content_width;
?>
">
			<tr><td class="message"><br /><?php 
echo $message;
?>
</td></tr>
			
		</table>
Example #6
0
function aclGrid($Z)
{
    #acGid prints the grid with the permission codes
    #input:$Z=compact('user_id', 'db');
    extract($Z);
    #CREATE THE HEADER AND SET THE TPL FILE
    if (!$users) {
        $s3ql = compact('user_id', 'db');
        $s3ql['select'] = '*';
        $s3ql['from'] = 'groups';
        $s3ql['where']['user_id'] = $user_id;
        $done = S3QLaction($s3ql);
        $groups = $done;
        #Got the groups, now figure out the users
        $users = array();
        if (is_array($groups)) {
            foreach ($groups as $group_info) {
                $s3ql = compact('user_id', 'db');
                $s3ql['select'] = '*';
                $s3ql['from'] = 'users';
                $s3ql['where']['group_id'] = $group_info['account_id'];
                if ($_REQUEST['orderBy'] != '') {
                    $s3ql['order_by'] = $_REQUEST['orderBy'] . ' ' . $_REQUEST['direction'];
                }
                $done = S3QLaction($s3ql);
                if (is_array($done)) {
                    foreach ($done as $user) {
                        array_push($users, $user);
                    }
                }
            }
        }
    }
    #replace the 0,1,2... of the array bu the account Id for making sure we get a unique list
    if (is_array($users) && !empty($users)) {
        $how_many = count($users);
        $datagrid = render_elements($users, $acl, array('User ID', 'Login', 'User Name', 'Access Control List'), 'account_acl', $new, $uid, $how_many);
    }
    return $datagrid;
}
Example #7
0
    $element = 'rule';
    $idNames = all(compact('element', 'db'));
    $MyPending = array_map('replace_id_with_name', $MyPending);
    $element = 'account';
    $idNames = all(compact('element', 'db'));
    $MyPending = array_map('replace_id_with_name', $MyPending);
    #echo '<pre>';print_r($MyPending);
    echo "<table border='0' width='100%'><tr bgcolor='#80BBFF'><td colspan='9' align='center'>My Pending Requests for Sharing</td></b>";
    echo "</tr><td><BR></td>";
    echo $table = render_elements($MyPending, $acl, $columns, 'access_rules');
}
#1 table for my Rules
if (is_array($myRules) && count($myRules) > 0) {
    if ($acl != 3) {
        $columns = array_diff($columns, array('Actions'));
    }
    #transform the array to include project names and requested by
    $element = 'project';
    $idNames = all(compact('element', 'db'));
    $myRules = array_map('replace_project_id_and_name', $myRules);
    $element = 'rule';
    $idNames = all(compact('element', 'db'));
    $myRules = array_map('replace_id_with_name', $myRules);
    $element = 'account';
    $idNames = all(compact('element', 'db'));
    $myRules = array_map('replace_id_with_name', $myRules);
    echo "<table border='0' width='100%'><tr bgcolor='#80BBFF'><td colspan='9' align='center'>My Shared Rules</td></b></table>";
    echo "</tr><td><BR></td>";
    echo $table = render_elements($myRules, $acl, $columns, 'access_rules');
}
echo '</form></td></tr></table>';
Example #8
0
    $_SESSION['list_all'] = '';
    Header('Location:' . $action['queryclass']);
    exit;
} elseif ($_REQUEST['listall'] == 'yes') {
    $S = compact('db', 'project_id', 'rule_id', 'acl', 'user_id');
    Header('Location:' . $action['queryresult'] . '&listall=yes&page=1');
    #go directly do result
    exit;
    #$instances = search_all($owner_project_id, $entity, $_REQUEST['entity_id']);
} else {
    #include all the javascript functions for the menus...
    include '../S3DBjavascript.php';
    #and the short menu for the resource script
    include '../action.header.php';
    if (is_array($rules)) {
        $datagrid = render_elements($rules, $acl, array('Rule_id', 'Subject', 'Verb', 'Object', 'Show', 'Value', 'Notes', 'Logic'), 'rule');
    } else {
        if ($classAcl == '3') {
            $datagrid = 'Before query, please create rules.';
        } else {
            $datagrid = 'No rules have been specified to be queried. The owner of the project or a level 3 permission user can create and edit rules.';
        }
    }
}
echo '<form name="queryresource" method="POST" action="' . $action['queryresult'] . '&main_resID=' . $_REQUEST['main_resID'] . '&main_rule=' . $_REQUEST['main_rule'] . '" autocomplete="on">
<td class="message" colspan="9"></td></tr>';
?>
	
</table>

<td class="message" colspan="9"></td></tr>
Example #9
0
    $rules = S3QLaction($s3ql);
    #echo '<pre>';print_r($rules);		exit;
    if (is_array($rules) && !empty($rules)) {
        #Set the cols to show up in the html table
        $columns = array('Rule_id', 'Owner', 'CreatedOn', 'SubjectAndId', 'VerbAndId', 'ObjectAndId', 'Validation', 'Notes', 'Actions');
        #replace all created_by with login_id
        $rules = replace_created_by($rules, $db);
        $rules = include_class_id($rules, $db);
        $elements = $rules;
        $rules = grab_acl(compact('user_id', 'elements', 'db'));
        if ($_REQUEST['action'] == 'edit') {
            $new = 0;
        } else {
            $new = 1;
        }
        $data_grid = render_elements($rules, $acl, $columns, 'rule', $new, 'R' . $_REQUEST['rule_id']);
        #show the table header
        $num_per_page = $_REQUEST['num_per_page'];
        $select[$num_per_page] = 'selected';
        $perPage = array('10', '50', '100', '150', '200', '250', '300', '350', '400', '450', '500');
        echo '<table class="middle" width="100%"  align="center"></a>
				<tr><td>
				<table class="insidecontents" width="100%" align="center">
				<tr bgcolor="#99CCFF"><td colspan="3" align="center">Rule Inspector</td></tr>
				<tr><td></td><td>Available Rules: ' . count($rules) . '</td><td align="right">Number of Results Per Page
				<select name="num_per_page" onChange="window.location=this.options[this.selectedIndex].value">';
        foreach ($perPage as $n) {
            echo '<option value="' . $thisScript . '&num_per_page=' . $n . '" ' . $select[$n] . '>' . $n . '</option>';
        }
        #Finally show the list of rules
        echo '</td></tr><tr><td colspan="3">' . $data_grid . '</td></tr></table>';
Example #10
0
$manager = 'Group Manager';
$s3ql = compact('user_id', 'db');
$s3ql['select'] = '*';
$s3ql['from'] = 'groups';
if ($user_id != '1') {
    $s3ql['where']['user_id'] = $user_id;
}
if ($_REQUEST['orderBy'] != '') {
    $s3ql['order_by'] = $_REQUEST['orderBy'] . ' ' . $_REQUEST['direction'];
}
#echo '<pre>';print_r($s3ql);
$groups = S3QLaction($s3ql);
#echo '<pre>';print_r($groups);
if (!empty($groups)) {
    $columns = array('Group ID', 'Group Name', 'Actions');
    $data_grid = render_elements($groups, $acl, $columns, 'groups');
} else {
    $message = 'No group yet. Please create one.';
}
$section_num = '2';
$website_title = $GLOBALS['s3db_info']['server']['site_title'] . ' - Admin';
$site_intro = $GLOBALS['s3db_info']['server']['site_intro'];
include S3DB_SERVER_ROOT . '/s3style.php';
include S3DB_SERVER_ROOT . '/tabs.php';
?>
<!-- BEGIN top -->
<form method="POST" action="<?php 
echo $action['listgroups'];
?>
">
<table class="top" align="center">
Example #11
0
                exit;
            } else {
                #if message is not empty, display it + a button to go back to projec
                $message .= '<BR><input type = "button" value = "Back to Project" onclick="window.location=\'' . $action['project'] . '\'">';
            }
        }
    }
    include_once '../S3DBjavascript.php';
    #echo '<pre>';print_r($shared_users);
    if (is_array($shared_users) && !empty($shared_users)) {
        for ($i = 0; $i < count($shared_users); $i++) {
            if (!is_numeric($shared_users[$i]['account_id'])) {
                $shared_users[$i]['account_id'] = base64_encode($shared_users[$i]['account_id']);
            }
        }
        $datagrid = render_elements($shared_users, $acl, array('Login', 'User Name', 'Access Control List'), 'account_acl');
    }
}
?>
<form name='insertAcl' action= "<?php 
echo $action['editproject'];
?>
" method="POST">
<table class="middle" width="100%" align="center">
	<tr><td>
		<table class="insidecontents" width="80%" align="center" border="0">
			<tr><td class="message" colspan="9"><?php 
echo $message;
?>
</td></tr>
			<tr bgcolor="#80BBFF"><td colspan="4" align="center">Edit Project</td></tr>
Example #12
0
     $instances = $sortedinstances;
 } else {
     $instances = $_SESSION['query_result'];
 }
 if ($_SESSION['sqlquery'] == '') {
     $_SESSION['sqlquery'] = array_pop($instances);
 }
 $_SESSION['for_summary'] = $instances;
 $tpl->set_var('back', '[<a href="javascript:history.go(-1)"><b> Back </b></a>]');
 if (count($instances) > 0) {
     $instances = include_data_acl(compact('instances', 'user_id', 'db'));
     #if($_REQUEST['listall']!='yes')
     $instances = include_statements($instances, $user_id, $db, $project_id);
     #echo '<pre>';print_r($instances);exit;
     //echo count($instances);
     $tpl->set_var('data_grid_instances', render_elements($instances, $acl, array('ResourceID', 'ResourceNotes', 'Statements', 'CreatedOn', 'Owner'), 'statements'));
     // find the name associated with main entity (only in cases where send result button is active)
     $db = $_SESSION['db'];
     $sql = "select entity from s3db_resource where resource_id='" . $class_info['main_resID'] . "' and project_id='" . $_REQUEST['project_id'] . "' and iid ='0'";
     $db->query($sql, __LINE__, __FILE__);
     //echo $sql;
     while ($db->next_record()) {
         $main_entity = array('entity' => $db->f('entity'));
     }
     //Lena's - create the send result button, which will close the window and reload the main table UID's to the main_table
     //	print_r ($main_entity);
     if (!empty($class_info['main_resID'])) {
         $tpl->set_var('send_query_button', '<input type="button" value="Send result to ' . $main_entity['entity'] . '" onclick="window.location=\'queryresource_main_page.php{get_proj_id}&entity_id=' . $class_info['main_resID'] . '\'">');
         ##This will create a session that will hold the result from the present query, in case the user is coming from another resource
         $entity_id = $_REQUEST['entity_id'];
         $_SESSION['result_list'][$entity_id] = '';
Example #13
0
include S3DB_SERVER_ROOT . '/s3style.php';
include S3DB_SERVER_ROOT . '/tabs.php';
if (is_array($users)) {
    $managerHead = '<tr bgcolor="#99CCFF"><td align="center">User Manager</td></tr>';
    if (user_is_admin($user_id, $db)) {
        if (!in_array('show_inactive', array_keys($_REQUEST))) {
            $inactive_user_link = '<a href="' . $action['listusers'] . '&show_inactive">Show Inactive Users</a>';
        } else {
            $inactive_user_link = '<a href="' . str_replace('&show_inactive', '', $action['listusers']) . '">Hide Inactive Users</a>';
        }
    }
    $cols2show = array('User ID', 'User Name', 'Login', 'Created Date', 'Actions');
    if (in_array('show_inactive', array_keys($_REQUEST))) {
        $cols2show = array_merge($cols2show, array('Account Status'));
    }
    $datagrid = render_elements($users, $acl, $cols2show, 'users');
} else {
    $message = 'No user yet. Please create one.';
}
#echo '<font color="red">'.$message.'</font>';
?>
<table class="top" align="center">
	<tr><td>
		<table class="insidecontents" align="center" width="80%">
			<tr><td class="message"><br /><br /><?php 
echo $message;
?>
</td></tr>
			<tr align="center"><td colspan="2" class="current_stage"></td></tr>
		</table>
	</td></tr>