3 set_include_path(get_include_path() . PATH_SEPARATOR
. '../lib');
5 include_once("aur.inc.php");
9 $title = __("Add Proposal");
13 if (isset($_COOKIE["AURSID"])) {
14 $uid = uid_from_sid($_COOKIE["AURSID"]);
17 if (has_credential(CRED_TU_ADD_VOTE
)) {
19 if (!empty($_POST['addVote']) && !check_token()) {
20 $error = __("Invalid token for user action.");
23 if (!empty($_POST['addVote']) && check_token()) {
26 if (!empty($_POST['user'])) {
27 if (!valid_user($_POST['user'])) {
28 $error.= __("Username does not exist.");
31 if (open_user_proposals($_POST['user'])) {
32 $error.= __("%s already has proposal running for them.", htmlentities($_POST['user']));
37 if (!empty($_POST['type'])) {
38 switch ($_POST['type']) {
40 /* Addition of a TU */
41 $len = 7 * 24 * 60 * 60;
46 $len = 7 * 24 * 60 * 60;
49 case "remove_inactive_tu":
50 /* Removal of a TU (undeclared inactivity) */
51 $len = 5 * 24 * 60 * 60;
55 /* Amendment of Bylaws */
56 $len = 7 * 24 * 60 * 60;
60 $error.= __("Invalid type.") ;
64 $error.= __("Invalid type.") ;
67 if (empty($_POST['agenda'])) {
68 $error.= __("Proposal cannot be empty.");
72 if (!empty($_POST['addVote']) && empty($error)) {
73 add_tu_proposal($_POST['agenda'], $_POST['user'], $len, $quorum, $uid);
75 print "<p class=\"pkgoutput\">" . __("New proposal submitted.") . "</p>\n";
79 <?php
if (!empty($error)): ?
>
80 <p style
="color: red;" class="pkgoutput"><?
= $error ?
></p
>
84 <h2
><?
= __("Submit a proposal to vote on.") ?
></h2
>
86 <form action
="<?= get_uri('/addvote/'); ?>" method
="post">
88 <label
for="id_user"><?
= __("Applicant/TU") ?
></label
>
89 <input type
="text" name
="user" id
="id_user" value
="<?php if (!empty($_POST['user'])) { print htmlentities($_POST['user'], ENT_QUOTES); } ?>" />
90 <?
= __("(empty if not applicable)") ?
>
93 <label
for="id_type"><?
= __("Type") ?
></label
>
94 <select name
="type" id
="id_type">
95 <option value
="add_tu"><?
= __("Addition of a TU") ?
></option
>
96 <option value
="remove_tu"><?
= __("Removal of a TU") ?
></option
>
97 <option value
="remove_inactive_tu"><?
= __("Removal of a TU (undeclared inactivity)") ?
></option
>
98 <option value
="bylaws"><?
= __("Amendment of Bylaws") ?
></option
>
102 <label
for="id_agenda"><?
= __("Proposal") ?
></label
><br
/>
103 <textarea name
="agenda" id
="id_agenda" rows
="15" cols
="80"><?php
if (!empty($_POST['agenda'])) { print htmlentities($_POST['agenda']); } ?
></textarea
><br
/>
104 <input type
="hidden" name
="addVote" value
="1" />
105 <input type
="hidden" name
="token" value
="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
106 <input type
="submit" class="button" value
="<?= __("Submit
"); ?>" />
113 print __("You are not allowed to access this area.");
116 html_footer(AURWEB_VERSION
);