Example #1
0
function check_login()
{
    global $admindir, $PHORUM, $q, $DB;
    $success = false;
    $user =& XMEC::getUser();
    if ($user->isLoggedIn()) {
        $PHORUM["admin_user"] = xmec_user_to_phorum_user($user);
        if (is_array($PHORUM["admin_user"]["forums"])) {
            $success = true;
        }
    }
    if (!$success && $user->isAdmin()) {
        $success = true;
    }
    if (!$success && $user->isLoggedIn()) {
        echo '<br><br>You need admin previliges..<br>';
    } else {
        if (!$success) {
            echo '<br><br>You need to login first.<br>';
        }
    }
    if (!$success) {
        include "{$admindir}/footer.php";
        exit;
    }
}
Example #2
0
function getJobPosts()
{
    $result = NULL;
    $count = 0;
    $user = XMEC::getUser();
    $dbh =& XMEC::getDB();
    $query = "SELECT *, DATE_FORMAT(post_date, '%D %b,%Y') from job_posts order by post_date";
    $queryHandle = $dbh->query($query);
    if (DB::isError($queryHandle)) {
        return $result;
    }
    while (is_array($title = $queryHandle->fetchRow())) {
        $result[$count++] = $title;
    }
    return $result;
}
Example #3
0
function renderLoginBox()
{
    global $PHP_SELF;
    $user = XMEC::getUser();
    if (!$user->isLoggedIn()) {
        ?>
<TABLE cellSpacing=2 height=80 cellPadding=0 border=0>
<form name=frmlogin method=POST action=login.php>
<input type=hidden name=xgetpage value=<?php 
        echo $PHP_SELF;
        ?>
>
<input type=hidden name=action value=login>
  <TR>
  	<TD colspan=2 align=center><img src="images/loginhead.jpg" ></TD>
  </TR>
  <TR>
  	<TD colspan=2 class=fname>Login</TD>
  </TR>
	<TR>
    <TD colspan=2><INPUT name=rollno type=text class=box size=10></TD>
  </TR>
  <TR>
  	<TD colspan=2 class=fname>Password</TD>
  </TR>
	<TR>
    <TD><INPUT name=passwd type=password class=box  size=10></TD>
		<TD  align=right><INPUT name=bttnlogin type=image src="images/go.gif" border=0 width=15 height=15></TD>

  </TR>


<TR>
<TD colspan=2 height=20 align=center><A class=link HREF="loginerror.php"><B>Forgot Password ?</B></A> </TD>

</TR>
</form> 
</TABLE>
<?php 
    }
}
Example #4
0
src="images/tb_left_topb.gif" width=3></TD>
<TD colSpan=2 rowSpan=2>
<!--center starts-->
<TABLE cellSpacing=0 cellPadding=1 width=527 border=0>
  <TR>
  	<TD width=25 rowspan=2><img src="images/space.gif"></TD>
  	<TD width=477 height=40 class=head></TD>
  	<TD width=25 rowspan=2><img src="images/space.gif"></TD>
  </TR>
  <TR>
  	<TD valign=top width=445 class=body><P><B>Add a note to the guestbook also called the XMEC Post pad.</B></font></P>

<form name="addpostit" method=POST action="guestbook/guestbook.pl">
<table><tr>
<?php 
$user =& XMEC::getUser();
if ($user->isLoggedIn()) {
    ?>
<td width="40%" class=name>Your Name</td><td><input type=text name=realname class=lbox></td></tr>
<tr><td class=name>Place</td><td> <input type=text name=state class=lbox> </td></tr>
<tr><td><input  type=hidden name=username class=lbox></td>
<td><input type=hidden type=text name=url class=lbox></td>
<td><input type=hidden type=text name=city class=lbox></td>
<td> <input type=hidden type=text name=country class=lbox></td></tr>
<tr><td class=name>Note</td><td><textarea name=comments class=tbox></textarea></td>
<?php 
} else {
    ?>
<td><input type=hidden name=realname value =" " class=lbox></td></tr>
<tr><td class=name>Name</td><td><input  name=username  class=lbox></td></tr>
<tr><td class=name>Email</td><td><input  type=text name=city class=lbox></td></tr>
Example #5
0
<?php

$secure_page = 1;
include 'header.php';
$user = XMEC::getUser();
?>
<!--center starts-->
<TABLE cellSpacing=0 cellPadding=1 width=527 border=0>
  <TR>
  	<TD width=25 rowspan=2><img src="images/space.gif"></TD>
  	<TD width=477 height=40 class=head><B>Add a News Item >></B> </TD>
  	<TD width=25 rowspan=2><img src="images/space.gif"></TD>
  </TR>
  <TR>
  	<TD valign=top width=445 class=body><BR><BR><strong>XMECians can post suitable News items or Activity in the site. The item will be added to the appropriate page on approval of the XMEC Moderator and Webmasters. MEC students and faculty can use the Placement cell access to use this facility.  </strong>
<script Language="JavaScript" src="jslibxmec.js">
</script>
<script language="javascript">

function check()
{

  if (false == validate())
  {
     
   }
   else
   document.addnews.submit();
   
 }   
function validate()
Example #6
0
<?php

$secure_page = 1;
$this_page = "college";
include 'header.php';
if (!XMEC::authenticate_user()) {
    echo "<html><h1>Please login to access this page<html>";
    exit;
}
$me =& XMEC::getUser();
if (!$me->isAdmin()) {
    echo "<html><h1>Not authorized !!</html>";
    exit;
}
$dbh =& XMEC::getDB();
if (!isset($_POST['submit'])) {
    ?>

<html>
<head>
</head>
<body>
<TABLE cellSpacing=0 cellPadding=4 width=90% align=center border=0>
  <TR>
		<TD width=6%><BR></TD>
		<TD width=90% height=40 class=head><B>XMEC Broadcast Mailer</B></TD>
  </TR>
<TR><TD colspan=2>
<!--Box Starts-->
<TABLE cellSpacing=0 cellPadding=0 border=0 width=90% align=center>
<TBODY>
Example #7
0
<?php

if (defined("_COMMON_PHP")) {
    return;
}
define("_COMMON_PHP", 1);
// These variables may be altered as needed:
// location where settings are stored
$settings_dir = "/usr163/home/x/m/xmec/settings/phorum_settings";
// no ending slash
// If you have dynamic vars for GET and POST to pass on:
// AddGetPostVars("dummy", $dummy);
// Get all XMEC stuff...
include_once "../xmec.inc";
XMEC::authenticate_user();
$xmec_user =& XMEC::getUser();
if ($xmec_user->isLoggedIn()) {
    $phorum_auth = $xmec_user->get('id');
} else {
    $phorum_auth = NULL;
}
//////////////////////////////////////////////////////////////////////////////////////////
// End of normally user-defined variables
//////////////////////////////////////////////////////////////////////////////////////////
// See the FAQ on what this does.  Normally not important.
// **TODO: make this a define and figure out where we really need it.
$cutoff = 800;
$phorumver = "3.3.2a";
// all available db-files
$dbtypes = array('mysql' => "MySQL", 'postgresql65' => "PostgreSQL 6.5 or newer", 'postgresql' => "PostgreSQL (older than 6.5)");
// handle configs that have register_globals turned off.
Example #8
0
function getTitles()
{
    $result = NULL;
    $count = 0;
    $user = XMEC::getUser();
    $dbh =& XMEC::getDB();
    #$query = "SELECT pollID,title,endDate FROM poll_questions where (endDate < '".
    #					$currentDate ."') order by endDate desc";
    if ($user->isAdmin()) {
        $query = "SELECT poll_id,title,DATE_FORMAT(end_date,'%b %D,%Y') FROM poll_questions order by end_date desc";
    } else {
        $query = "SELECT poll_id,title,DATE_FORMAT(end_date,'%b %D,%Y') FROM poll_questions where " . "(end_date < NOW()) order by end_date desc";
    }
    $queryHandle = $dbh->query($query);
    if (DB::isError($queryHandle)) {
        return $result;
    }
    while (is_array($title = $queryHandle->fetchRow())) {
        $result[$count++] = $title;
    }
    /* $result['count'] = $count; */
    return $result;
}
Example #9
0
<?php

include 'SimpleImage.php';
include 'xmec.inc';
include 'header.php';
if (!XMEC::authenticate_user()) {
    echo "<html><h2>Please login to access this page<html>";
    exit;
}
$res =& XMEC::getUser();
$img = "profile/thumbnails/" . str_replace("/", "_", $res->get('id')) . ".jpg";
?>
CURRENT IMAGE:<br>
<img src=<?php 
if (file_exists($img)) {
    echo $img . "?r=" . rand();
} else {
    echo "profile/thumbnails/default.jpg";
}
?>
>
<br>
Upload New Image
<?php 
echo $img;
if (isset($_POST['submit']) && $_FILES['uploaded_image']['tmp_name'] != "") {
    echo $img;
    $image = new SimpleImage();
    $image->load($_FILES['uploaded_image']['tmp_name']);
    $image->resizethumbnail();
    $image->save($img);
Example #10
0
 function user_logout()
 {
     session_cache_limiter('nocache');
     session_start();
     session_destroy();
     $user =& XMEC::getUser();
     if ($user->isLoggedIn()) {
         XMEC::log('LOGOUT', $user->get('id'));
         $user = new XMEC_user();
     }
 }