for ($i = 0; $i < count($projects); $i++) { if ($projects[$i]['project_id'] == $_POST['remote_project_id'] && $projects[$i]['URI'] == $_POST['URI']) { $found_project .= True; } } 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">
if ($class_id != '') { $s3ql['where']['subject_id'] = $class_id; $s3ql['where']['object'] = "!=UID"; #$s3ql['where']['object'] = "[^(UID)]"; } if ($_REQUEST['orderBy'] != '') { $s3ql['order_by'] = $_REQUEST['orderBy'] . ' ' . $_REQUEST['direction']; } #echo '<pre>';print_r($s3ql);exit; $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>
$s3ql['select'] = '*'; $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>
} else { #find the rules in the class, these will be usefull for the query $S = compact('db', 'project_id', 'rule_id', 'resource_info', 'project_info', 'user_id'); $orderBy = $_REQUEST['orderBy'] . ' ' . $_REQUEST['direction']; $instances = search_resource(compact('rules', 'db', 'orderBy')); #echo '<pre>';print_r($instances);exit; $sqlquery = $instances['sqlquery']; if (is_array($instances)) { $instances = array_diff_key($instances, array('sqlquery' => '')); $instances = array_filter($instances); } } if (is_array($instances) && !empty($instances)) { $_SESSION['queryresult'] = ''; #interpret user_acl on each instance $instances = replace_created_by($instances, $db); #now find the list of rules, make rule_id the key and append the rule info into the statement info if ($_REQUEST['statements'] != '' || count($instances) <= 50) { $instances = include_statements(compact('rules', 'instances', 'user_id', 'db', 'project_id')); } else { $instances = includeStatementLink($instances); } #echo '<pre>';print_r($instances);exit; #$instances = include_data_acl(compact('instances', 'user_id', 'db')); #$instances = include_statements(compact('db', 'user_id', 'rules', 'instances')); $_SESSION[$user_id]['instances'][$class_id] = $instances; $_SESSION['queryresult'] = $instances; $datagrid = render_elements($instances, $acl, array('ResourceID', 'ResourceNotes', 'Form', 'Statements', 'CreatedOn', 'Owner'), 'statements'); } else { $message_report .= 'Your query returned no results.'; }