for ($i = 0; $i < 8; $i++) { $r = $right; $r['right_num'] = $i; $r['right_checked'] = array(); if ($right['rights'] & pow(2, $i)) { $r['right_checked'][] = array(); } $right['right'][$i] = $r; } return $right; } $output->secure(); $entry = new entry(); $entry->get(); $entry->load(); $entry->check_right('rights'); $changed = false; if (isset($_POST['rights'])) { $entry->update_rights($_POST['rights']); $changed = true; } if (isset($_POST['new_rights'])) { $entry->create_rights($_POST['new_rights']); $changed = true; } if ($changed) { redirect('rights.php?id=' . $entry->data['id']); } $v['id'] = $entry->id; $v['entry'] = $entry->format('entry.html'); $rights = rights_of($entry->data['id']);
<?php /* * This file is part of Infoschool - a web based school intranet. * Copyright (C) 2006 Maikel Linke */ include 'var.php'; $output->secure(); $entry = new entry(); $entry->get(); $entry->load(); $entry->check_right('read'); $entry->load_answers($max_depth, 'read'); $v['entry'] = $entry->format('entry.html'); $v['history'] = $entry->fdata['history']; $v['answers'] = format_answers($entry); $content = new tmpl('entry_answers.html', $v); $output->out($content);
<?php /* * This file is part of Infoschool - a web based school intranet. * Copyright (C) 2006 Maikel Linke */ include 'var.php'; $output->secure(); $entry = new entry(); $entry->get(); $entry->load(); $entry->check_right('edit'); if (!$entry->right_edit()) { redirect('./'); } if (isset($_POST['entry'])) { $entry->update($_POST['entry']); redirect('entry.php?id=' . $entry->data['id']); } $content = $entry->format('edit.html'); $output->out($content);