Commit 7cca3ca1 authored by Imran Hussain's avatar Imran Hussain

Merge branch 'beta' into sucs-site

Conflicts:
	htdocs/images/lastsnap.jpg
parents 8fc87a67 0088ed5e
# Some of the files that are generated by the setup script don't want to be version controlled.
# To that end I have added this .gitignore file to ignore the following files and folders
# This is the generated .htaccess
htdocs/.htaccess
# Generated settings.php file
settings.php
# Compiled templates_c
templates_c/
# Password file for the su-api thing
suapi.inc.php
# lastsnap.jpg from cam
htdocs/images/lastsnap.jpg
\ No newline at end of file
[submodule "htdocs/js/ckeditor"]
path = htdocs/js/ckeditor
url = git://github.com/ckeditor/ckeditor-releases.git
......@@ -457,6 +457,11 @@ table.border a:link {
padding-left: 1em;
}
form.admin {
float: left;
}
/* --------------------------------------------------
Hacks to work around inadequacies of TinyMCE
-------------------------------------------------- */
......
<?
function msg_tx($text, $time, $fg, $bg)
{
$f = fopen("http://door.sucs.org/sendstatus.py?text=".urlencode($text)."&amp;timeout=$time&amp;fg=$fg&amp;bg=$bg", "r");
fclose($f);
}
function msg_good($text, $time=5)
{
msg_tx($text, $time, "0,0,0", "128,255,128");
}
function msg_bad($text, $time=3)
{
msg_tx($text, $time, "0,0,0", "255,64,64");
}
header("Content-type: text/plain");
// Initialise the database
require("/usr/share/adodb/adodb.inc.php");
$DB = NewADOConnection('postgres8');
if ($DB->Connect('dbname=sucs') === FALSE) {
echo "DB fail\n";
exit;
}
$DB->SetFetchMode(ADODB_FETCH_ASSOC);
$f = fopen("/tmp/doorlog", "a");
if (isset($_REQUEST['code'])) {
// Expire old requests
$DB->Execute("delete from doorknock where start < NOW() - 30 seconds:reltime");
// Parse out the string
$code = $_REQUEST['code'];
$codes = split(' ',$code);
if ($codes[0] != "SUCS") {
echo "Unrecognised codeword '{$codes[0]}'\n";
msg_bad("Invalid slip");
exit;
}
// look up the user
$user = $DB->GetAll("select * from signup where id=?",array($codes[1]));
if (!is_array($user) || count($user) < 1) {
echo "Unrecognised signup id\n";
msg_bad("Invalid slip");
exit;
}
if ($codes[2] != $user[0]['password']) {
echo "Password mismatch\n";
msg_bad("Invalid slip");
exit;
}
if ($user[0]['card'] != "") {
echo "User already has a card\n";
msg_bad("Slip already used");
exit;
}
// all looks valid so far
// check we arent bouncing ourselves out
$exist = $DB->GetAll("select * from doorknock");
if (is_array($exist) && count($exist) > 0) {
print_r($exist);
if ($exist[0]['suid'] == $user[0]['id']) {
echo "Already in progress, no action\n";
exit;
}
$DB->Execute("delete from doorknock");
echo "Bouncing out signup id={$exist[0]['suid']}\n";
}
$DB->Execute("insert into doorknock (suid,start) values(?,NOW())", array($user[0]['id']));
echo "Start waiting for id={$user[0]['id']}\n";
msg_good("Please swipe ID Card to complete registration", 10);
exit;
} else
// a card was swiped at the door, try to match it
if (isset($_REQUEST['id'])) {
$card = $_REQUEST['id'];
$exist = $DB->GetAll("select * from doorknock");
if (!is_array($exist) || count($exist) < 1) {
echo "No registration in progress, ignoring.\n";
exit;
}
$signup = $DB->GetAll("select * from signup where id=?",array($exist[0]['suid']));
if (!is_array($signup) || count($signup) < 1) {
echo "Unrecognised signup id\n";
msg_bad("Invalid slip");
$DB->Execute("delete from doorknock");
exit;
}
// should really check the card isnt already registered first
$DB->Execute("update signup set card=? where id=?", array($card, $signup[0]['id']));
echo "Registering card '$card' to signup id {$signup[0]['id']}\n";
$DB->Execute("delete from doorknock");
// User is registered, stick it in the real doorcards list too
if ($signup[0]['username'] != "") {
$user = $DB->GetAll("select * from members where username=?", array($signup[0]['username']));
if (!is_array($user) || count($user) < 1) {
echo "Cant find username '{$signup[0]['username']}' to full reg the card\n";
} else {
$DB->Execute("insert into doorcards (uid, cardnumber) values (?,?)", array($user[0]['uid'], $card));
echo "Registering card to uid={$user[0]['uid']} username {$user[0]['username']}\n";
}
}
unlink("/tmp/cards");
system("/usr/local/bin/db-to-cards.php");
system("sudo /usr/local/bin/putcardsfile");
unlink("/tmp/cards");
msg_good("Card now registered, swipe again for access");
exit;
}
?>
Subproject commit a93cb51eb1fc85a13892706dd61eccfd4c999947
$( document ).ready(function() {
console.log( "ready!" );
CKEDITOR.replace( 'body' );
});
This diff is collapsed.
......@@ -28,12 +28,18 @@ if (isset($session->groups[$permission])) {
$why = $_POST['why'];
if ( abs($number) <= $maxbanana ){
if ( (abs($number) <= $maxbanana ) && $number ){
$DB->Query("INSERT INTO awards (username, score, whn, who, why) VALUES (?,?,NOW(),?,?)", array($who, $number, $session->username, $why));
header("Location: " . $_SERVER['PHP_SELF']);
header("Location: " . $_SERVER['PHP_SELF']);
} else {
}
// Checks for a nonzero banana and denies awarding if it's zero
elseif ( $number == 0 ){
trigger_error("Come on ".$session->username.", enter a nonzero value please");
}
else {
trigger_error("Nice try ".$session->username."! You've submitted a request with too many bananas");
}
......
......@@ -227,7 +227,7 @@ private $datahash=''; // hash of data field
}*/
// a sure-fire way to check to see if the user has any unread email
// the bash script returns 0 for no and 1 for yes, takes one arg, username
$this->email = shell_exec("/home/member/imranh/bin/sucsunreadmail $user");
$this->email = shell_exec("../plugins/sucsunreadmail $user");
if (file_exists($info['homedirectory'][0]."/.forward")) {
$forward = file($info['homedirectory'][0]."/.forward");
......
<?php
function smarty_modifier_encodestring($string) {
$string = rawurlencode($string);
$string = str_replace("_", "%5F", $string);
$string = str_replace("%20", "_", $string);
return $string;
}
?>
#!/bin/bash
if finger -m $1 | grep "New mail" &> /dev/null
then
echo "1"
else
echo "0"
fi
\ No newline at end of file
......@@ -4,7 +4,7 @@ $base = "$BASEDIR/";
$baseurl = "/~$USERNAME/sucssite";
$preferred_hostname = "sucs.org";
$dbname="beta";
$sucsdbname="sucs";
$sucsdbname="sucs-dummy";
$dbuser="$USERNAME";
// Settings for current election (god knows why they are here):
......
......@@ -6,9 +6,9 @@ Community</h3>
<dt><a href="Community/Talks">SUCS Lightning Talks</a></dt>
<dd>A great way to share things you are passionate about with fellow members. We've had 3 Lightning Talks so far in the past 2 years and each of them have been very well received. Footage of the talks can also be found in this section.</dd>
<dt><a href="Community/Projects">SUCS Projects</a></dt>
<dd>SUCS hosts a number of open source coding projects and offers its members Subversion repositories and Trac wiki/ticket trackers to manage their projects. The projects page lists a number of projects which SUCS members are currently working on, and which you can get involved with.</dd>
<dd>SUCS hosts a number of open source coding projects and offers its members Git & Subversion repositories. To enhance these repositories we also provide Gitlab Projects & the Trac wiki/ticket tracking system to assist in the management of projects. The projects page lists a number of projects which SUCS members are currently working on, and which you can get involved with.</dd>
<dt>Socials</dt>
<dd>We regularly meet in JC's every Wednesday at 1PM. It's a great chance to get to know everyone and have a chat with people. </dd>
<dd>We regularly meet in JCs every Wednesday at 1PM and most Fridays at 7PM. It's a great chance to get to know everyone and have a chat with people. </dd>
</dl>
<h3>Other ways</h3>
<ul>
......
../../htdocs/planet/Planet.txt
\ No newline at end of file
......@@ -274,4 +274,4 @@
<h2><a id="problems">Problems</a></h2>
<dl>
<dt><a id="prob1">Something has gone awry with one of the SUCS services, where can I get help?</a></dt>
<dd>If it is not answered in this section of the FAQ or in the Help files, e-mail the admin team. </dd></dl>
\ No newline at end of file
<dd>If it is not answered in this section of the FAQ or in the Help files, e-mail the admin team. </dd></dl>
......@@ -28,6 +28,18 @@
</div>
</div>
{if $action=="edit"}
<!--
<script language="javascript" type="text/javascript" src="{$baseurl}/js/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript" src="{$baseurl}/js/tiny_mce.js"></script>
--!>
<script language="javascript" type="text/javascript" src="{$baseurl}/js/jquery-2.1.3.min.js"></script>
<script language="javascript" type="text/javascript" src="{$baseurl}/js/ckeditor/ckeditor.js"></script>
<script language="javascript" type="text/javascript" src="{$baseurl}/js/ckeditor.js"></script>
{/if}
{if $debug}{debug}{/if}
</body>
</html>
......@@ -29,10 +29,6 @@
<meta name="description" content="Swansea University Computer Society - providing student computing facilities and personal web pages." />
{if $refresh} <meta http-equiv="REFRESH" content="{$refresh}" />{/if}
{if $action=="edit"}
<script language="javascript" type="text/javascript" src="{$baseurl}/js/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript" src="{$baseurl}/js/tiny_mce.js"></script>
{/if}
{if isset($extra_scripts)}
{foreach from=$extra_scripts item=script}
......
......@@ -127,7 +127,7 @@
<label for="email">External Email:</label>
<span class="textinput">
<input type="text" name="email" id="email" value="{$member.email}" style="width: 95%;" />
<div class="note">We are required by the Student Union to keep contact details for our members. Please note that these details will be held in accordance with the Data Protection Act.</div>
<div class="note">We are required by the Students' Union to keep contact details for our members. Please note that these details will be held in accordance with the Data Protection Act.</div>
</span>
</div>
<div class="row">
......
<h3>Projects currently hosted by SUCS</h3>
<p>SUCS has recently deployed <a href="https://projects.sucs.org/explore">Gitlab</a> with a more expansive list of projects.</p>
<dl>
{foreach name=projects from=$projects item=project}
<dt><a href="http://projects.sucs.org/projects/{$project.filename}">{$project.name}</a></dt>
{if $project.descr}<dd>{$project.descr}{/if}</dd>
{/foreach}
</dl>
</dl>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment