3 set_include_path(get_include_path() . PATH_SEPARATOR
. '../lib');
5 include_once("aur.inc.php");
7 $title = __("Add Proposal");
11 if (isset($_COOKIE["AURSID"])) {
12 $uid = uid_from_sid($_COOKIE["AURSID"]);
15 if (has_credential(CRED_TU_ADD_VOTE
)) {
17 if (!empty($_POST['addVote']) && !check_token()) {
18 $error = __("Invalid token for user action.");
21 if (!empty($_POST['addVote']) && check_token()) {
24 if (!empty($_POST['user'])) {
25 if (!uid_from_username($_POST['user'])) {
26 $error.= __("Username does not exist.");
29 if (open_user_proposals($_POST['user'])) {
30 $error.= __("%s already has proposal running for them.", htmlentities($_POST['user']));
35 if (!empty($_POST['type'])) {
36 switch ($_POST['type']) {
38 /* Addition of a TU */
39 $len = 7 * 24 * 60 * 60;
44 $len = 7 * 24 * 60 * 60;
47 case "remove_inactive_tu":
48 /* Removal of a TU (undeclared inactivity) */
49 $len = 5 * 24 * 60 * 60;
53 /* Amendment of Bylaws */
54 $len = 7 * 24 * 60 * 60;
58 $error.= __("Invalid type.") ;
62 $error.= __("Invalid type.") ;
65 if (empty($_POST['agenda'])) {
66 $error.= __("Proposal cannot be empty.");
70 if (!empty($_POST['addVote']) && empty($error)) {
71 add_tu_proposal($_POST['agenda'], $_POST['user'], $len, $quorum, $uid);
73 print "<p class=\"pkgoutput\">" . __("New proposal submitted.") . "</p>\n";
77 <?php
if (!empty($error)): ?
>
78 <p style
="color: red;" class="pkgoutput"><?
= $error ?
></p
>
82 <h2
><?
= __("Submit a proposal to vote on.") ?
></h2
>
84 <form action
="<?= get_uri('/addvote/'); ?>" method
="post">
86 <label
for="id_user"><?
= __("Applicant/TU") ?
></label
>
87 <input type
="text" name
="user" id
="id_user" value
="<?php if (!empty($_POST['user'])) { print htmlentities($_POST['user'], ENT_QUOTES); } ?>" />
88 <?
= __("(empty if not applicable)") ?
>
91 <label
for="id_type"><?
= __("Type") ?
></label
>
92 <select name
="type" id
="id_type">
93 <option value
="add_tu"><?
= __("Addition of a TU") ?
></option
>
94 <option value
="remove_tu"><?
= __("Removal of a TU") ?
></option
>
95 <option value
="remove_inactive_tu"><?
= __("Removal of a TU (undeclared inactivity)") ?
></option
>
96 <option value
="bylaws"><?
= __("Amendment of Bylaws") ?
></option
>
100 <label
for="id_agenda"><?
= __("Proposal") ?
></label
><br
/>
101 <textarea name
="agenda" id
="id_agenda" rows
="15" cols
="80"><?php
if (!empty($_POST['agenda'])) { print htmlentities($_POST['agenda']); } ?
></textarea
><br
/>
102 <input type
="hidden" name
="addVote" value
="1" />
103 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
104 <input type
="submit" class="button" value
="<?= __("Submit
"); ?>" />
111 print __("You are not allowed to access this area.");
114 html_footer(AURWEB_VERSION
);