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 hasUserVoted($user = null)
 {
     $query = "SELECT vote_ans from poll_responses where (" . "(poll_id = " . $this->pollID . ") and" . "(user_id = '" . $user->id . "'))";
     $dbh =& XMEC::getDB();
     $queryHndl = $dbh->query($query);
     if (DB::isError($queryHndl)) {
         $pollError = "Database Query failed.<BR>";
         return -1;
     }
     $res = $queryHndl->fetchRow();
     return $res[0];
 }
Example #3
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 #4
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 #5
0
  
  <TR>
    <TD></TD>
    <TD colSpan=2></TD>
    <TD></TD></TR>
  <TR>
    <TD><FONT face=Verdana size=2>Name</FONT></TD>
    <TD><FONT face=Verdana size=2><INPUT id=text1 name=name value=<?php 
echo $name;
?>
></FONT></TD>
    <TD nowrap><FONT face=Verdana size=2>Field of Work</FONT>  </TD>
    <TD><FONT face=Verdana size=2><select name=worktype>
	<option value="">--- Any ---</option>
<?php 
$wrk = XMEC::get_work_types();
for ($i = 0; $i < sizeof($wrk); $i++) {
    echo "<option value=\"" . htmlentities($wrk[$i]) . "\">" . htmlentities($wrk[$i]) . "</option>";
}
?>
	</SELECT>	
		
</FONT></TD></TR>
  <TR>
    <TD nowrap><FONT face=Verdana size=2>Year of Joining</FONT>  </TD>
    <TD><FONT face=Verdana size=2><select name=year>
	<option value="">--- Select ---</option>
<?php 
for ($y = 1989; $y <= 2001; $y++) {
    echo "<option value=\"{$y}\">{$y}</option>";
}
Example #6
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 #7
0
    $userid = chop($HTTP_POST_VARS["rollno"]);
    $pass = chop($HTTP_POST_VARS["passwd"]);
    if (XMEC::authenticate_user()) {
        XMEC::user_logout();
    }
    if (!XMEC::user_login($userid, $pass)) {
        //header("Location: failedlogin.php");
        //exit;
        $login_failed = 1;
    } else {
        header("Location: {$target}");
        exit;
    }
} else {
    if ($action == "logout") {
        XMEC::user_logout();
        header("Location: {$target}");
        exit;
    }
}
//$target = urlencode($target);
$no_search_menu = 1;
include 'header.php';
?>
<CENTER>
<BR>
<!--center starts-->
<!-- Box starts -->
<TABLE cellSpacing=0 cellPadding=0 border=0>
<TBODY>
        <TR>
<?php

$__me =& XMEC::getUser();
if (!$__me->isAdmin()) {
    exit;
}
$res =& XMEC::search($search_fil, $search_start, $search_count);
$no_links = 5;
// half the no. of navigation links (1 2 3...)
?>
<!-- Box starts -->
<TABLE width = 90% align=center cellSpacing=0 cellPadding=0 border=0>
<TBODY>
        <TR>
                <TD width=4 height=4><IMG height=4 src="images/corner.gif" width=4></TD>
        <TD align=left background=images/tb_top.gif height=4><IMG height=4 src="images/tb_left_topt.gif" width=8></TD>
        <TD align=right background=images/tb_top.gif height=4><IMG height=4 src="images/tb_right_topt.gif" width=8></TD>
        <TD width=4 height=4><IMG height=4 src="images/corner.gif" width=4></TD>
    </TR>
    <TR>
                <TD vAlign=top width=4 background=images/tb_left.gif height="50%"><IMG height=6 src="images/tb_left_topb.gif" width=3></TD>
                <TD colSpan=2 rowSpan=2>
                        <!--contents starts-->

<TABLE border=0 cellPadding=0 cellSpacing=3 width=100%>

<?php 
$total = $res['total'];
if ($res['total'] > $search_count) {
    $rem = (int) (($res['total'] + $search_count - 1) / $search_count);
    $current = (int) (($search_start + $search_count - 1) / $search_count);
Example #9
0
        <TD align=right background=images/tb_top.gif height=4><IMG height=4 src="images/tb_right_topt.gif" width=8></TD>
        <TD width=4 height=4><IMG height=4 src="images/corner.gif" width=4></TD>
    </TR>
    <TR>
    <TD vAlign=top width=4 background=images/tb_left.gif height="50%"><IMG height=6 src="images/tb_left_topb.gif" width=3></TD>
    <TD colSpan=2 rowSpan=2>

<!-- Content Starts -->
<table width="100%" border=0>
<tbody>
	<tr><td colspan=3 bgcolor="#e7f3fb" class=name><b>&nbsp;&nbsp;Batchwise Profile Updation</b></td></tr>
<?php 
$bgcolor[0] = "#e7f3fb";
$bgcolor[1] = "#ffffff";
//$limit="LIMIT 1,10";
$x = XMEC::get_company();
echo "<tr>";
for ($i = 0; $i < count($x); $i++) {
    echo "<tr>";
    echo "<td><P>{$x[$i]}</P></td>";
    echo "</tr>";
}
echo "</tr>";
?>

</tbody>
</table>
<!--Content Ends-->
    </TD>
    <TD vAlign=top width=4 background=images/tb_right.gif height="50%"><IMG height=6 src="images/tb_right_topb.gif" width=3></TD>
  </TR>
Example #10
0
<?php

include 'common.php';
$auth = XMEC::authenticate_user();
$user =& XMEC::getUser();
if (!$user->isAdmin()) {
    echo '<h2>Not Authorized !</h2>';
    exit;
}
?>
	

<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
<LINK href="style.css" type="text/css" rel="Stylesheet">
</HEAD>
<BODY bgcolor="#ffffff">

<P>
<?php 
$wrk =& XMEC::get_update_list();
echo "<b>Total entries: " . sizeof($wrk) . "</b><br>";
for ($i = 0; $i < sizeof($wrk); $i++) {
    echo $wrk[$i] . "<br>";
}
?>
</BODY>
</HTML>
Example #11
0
        echo htmlentities($res->get('work_type'));
        ?>
</TD></TR> 
<TR>
<TD class=sbecord bgcolor=#FFFFCC  width=370 align=left><strong>Personal Email</strong></TD>
<TD class=becord bgcolor=#FFFFCC  width=370 align=left>
<?php 
        echo XMEC::pref_print(htmlentities($res->get('personal_email')), $res->getPref('personal_email'), $auth);
        ?>
</TD>
</TR>
<TR>
<TD class=sbecord bgcolor=#FFFFCC  width=370 align=left><strong>Official Email</strong></TD>
<TD class=becord bgcolor=#FFFFCC  width=370 align=left>
<?php 
        echo XMEC::pref_print(htmlentities($res->get('official_email')), $res->getPref('official_email'), $auth);
        ?>
</TD>
</TR>
<?php 
        if ($comp_addr->get('house_name') != "" && ($comp_addr->get('visibility') == 'PUBLIC' || $comp_addr->get('visibility') == 'XMEC' && $auth)) {
            ?>

<TR>
<TD class=sbecord bgcolor=#FFFFCC  width=370 align=left valign=top><strong>Organisation</strong></TD>
<TD class=becord bgcolor=#FFFFCC  width=370 align=left>
<strong><?php 
            echo htmlentities($comp_addr->get('house_name'));
            ?>
</strong><br>
<?php 
Example #12
0
<?php

include 'xmec.inc';
if (!XMEC::authenticate_user()) {
    echo "<html><h1>Please login to access this page<html>";
    exit;
}
reset($HTTP_POST_VARS);
$action = chop($HTTP_POST_VARS["todo"]);
if ($REQUEST_METHOD == "GET") {
    $action = chop($HTTP_GET_VARS["todo"]);
}
$me =& XMEC::getUser();
$user = $me;
$admin = FALSE;
if ($me->isAdmin() && isset($id) && $id != "" && $_s == 1) {
    $admin = TRUE;
    $user = new XMEC_user($id);
    if (!$user->fetchInfo()) {
        echo "<html><h1>ID not found !</html>";
        exit;
    }
}
$pemail_pref = $user->getPref('personal_email');
$oemail_pref = $user->getPref('official_email');
$curr_visib = $user->getAddressVisibility('PRESENT');
$comp_visib = $user->getAddressVisibility('COMPANY');
$perm_visib = $user->getAddressVisibility('PERMANENT');
$pass_st = "";
$email_st = "";
$addr_st = "";
Example #13
0
var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',noresizable'
win = window.open(mypage,myname,settings)
//if(win.window.focus){win.window.focus();}//
}
</SCRIPT>

</HEAD>
<BODY bgcolor="#FFFFFF" topmargin=0 leftmargin=0 marginheight = "0" marginwidth = "0">
<?php 
include 'common.php';
if (!XMEC::authenticate_user()) {
    echo "<h2>Please login to access this page</h2>\r\n";
    exit;
}
?>
<TABLE align=left border=0 cellPadding=0 cellSpacing=0 width="615" height=100%>
<TR>
<TD valign=top width=445><img src="images/head_newsl.gif" width="218" height="35"><BR><BR>
<HR width=100% color="#CCCCCC">
<P><strong><img src="images/letter.gif"><font face=garamond size=3 color="#669999">To Draft an Effective Resume</font></strong></P>
<P><font face=garamond size=3>Many of you may be planning to look for a job in India. Apart from preparing for the tests, brushing up the subjects etc, one has to put some effort in drafting one's resume . Given the scenario that we are in now, the first impression definitely scores more
brownie points. Consider the position of the HR in charge of recruitment in a company. The moment they declare that they going to recruit, his or her mail box and table is bombarded with resumes of all kinds. The HR is now daunted with the tedious task of choosing the eligible ones from the pile of resumes. Given the fact that the number of resumes run in hundreds and even thousands, he or she can choose to be harsh when it comes to discarding resumes without adequate details, poor language, poor format etc. Here are a few tips that we learnt from our seniors when we came over on the  search for a job here. </font></P><BR>
<P><font face=garamond size=3><img src="images/pen.gif"><big><font face=garamond size=3>Legibility</font></big><BR>Make sure that your resume is legible. Always use a standard font like Arial or Times New Roman. Do not use any fancy font for it may not be installed on the personal computer of the person evaluating your resume.Choose a font size that appears good on an A4 size page layout. Size 12 would be readable enough. Take care to see that the paragraphs are aligned, and the spacing between lines are adequate. There is no point in squeezing text into the lesser number of pages at the expense of legibility</font></P><BR>
<P><font face=garamond size=3><img src="images/pen.gif"><big><font face=garamond size=3>Address for Communication</font></big><BR>Make sure that your address for communication is visible at one glance, hence it would be preferable if it is placed on the first page itself. It has been noticed that often addresses from within Bangalore (Chennai or Hyderabad etc) would be given preference over outstation addresses because it helps them avoid the confusions of arrival delays, communication problems etc. Hence it is advised to put a communication address respective of the place where you are applying. In short if you are applying for a company in Bangalore try to devise an  address of communication in Bangalore itself. It is safer to use the mailing address of your relatives, classmates or friends in Bangalore. Avoid using their company addresses lest they be mistaken to be applying for another job from their present company. This may land them in unwarranted trouble. Give the residential address of somebody who will be more than willing to convey the message the earliest. The phone number you put should  preferably be a local number. Make sure that the number you give is accessible most of the time.  The HR wont care  to call you after two or three failed attempts . If you can get the permission of your friends to use their direct office number ( preferably those without extension) that would be perfect .</font></P><BR>
<P><font face=garamond size=3><img src="images/pen.gif"><big><font face=garamond size=3>Content</font></big><BR>Be sure to mention all your technical and personal strengths. Often the interviewer frames his queries based on your strengths, hence it would be foolhardy to mention subjects and domains that you are least comfortable in, as strengths. That doesn't however mean that you should mention subjects in your strengths list only if you have mastered the whole subject. It just means that one should put subjects and skills in strength that one is fairly confident of. Other subjects and skill that you are aware of and possess general knowledge can be posted as your interests.</font></P><BR>
<P><font face=garamond size=3><strong>Please do write a brief description of your Mini Project and Main Project </strong>. Be sure to mention  specific tools and software if you have used any. There is also the possibility that they would have been on the lookout  for someone with that particular kind of experience. Mention what languages, development kits you have used . In case of hardware, mention the critical components used, especially micro-controller, processor etc. Many  have got calls for tests and interviews just because their academic projects caught their interest.</font></P><BR>
Example #14
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 #15
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 #16
0
    <TR>
    <TD vAlign=top width=4 background=images/tb_left.gif height="50%"><IMG height=6 src="images/tb_left_topb.gif" width=3></TD>
    <TD colSpan=2 rowSpan=2>

<!-- Content Starts -->
<table width="100%" border=0>
<tbody>
	<tr><td colspan=2 bgcolor="#e7f3fb" class=name><b>&nbsp;&nbsp;Batchwise Profile Updation</b></td></tr>
<?php 
$bgcolor[0] = "#e7f3fb";
$bgcolor[1] = "#ffffff";
for ($i = 1; $i < 12; $i++) {
    #### For 11 Batches; Add 1 every year!!
    $year = $i + 1988;
    echo '<tr><td bgcolor="' . $bgcolor[$i % 2] . '" class=body>&nbsp;<a href="search.php?year=' . $year . '&.s=Search" class=link> Batch ' . $i . ' (' . $year . '-' . ($year + 4) . ') </a></td>';
    echo '<td bgcolor="' . $bgcolor[$i % 2] . '" class=body>' . count(XMEC::get_update_list($year)) . '/' . XMEC::get_user_count($year) . '</td></tr>';
}
?>
</tbody>
</table>
<!--Content Ends-->
    </TD>
    <TD vAlign=top width=4 background=images/tb_right.gif height="50%"><IMG height=6 src="images/tb_right_topb.gif" width=3></TD>
  </TR>
  <TR>
    <TD vAlign=bottom width=4 background=images/tb_left.gif height="50%"><IMG height=6 src="images/tb_left_bottomb.gif" width=3></TD>
    <TD vAlign=bottom width=4 background=images/tb_right.gif height="50%"><IMG height=6 src="images/tb_right_bottomb.gif" width=3></TD>
  </TR>
    <TR>
    <TD width=4 height=4><IMG height=4 src="images/corner.gif" width=4></TD>
    <TD align=left background=images/tb_bottom.gif height=4><IMG height=4 src="images/tb_left_bottomt.gif" width=8></TD>
Example #17
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 #18
0
        $addr->set('visibility', $p);
    }
    $user->addrBackup('PRESENT');
    if (!$user->setAddress($addr, 'PRESENT')) {
        XMEC::error_exit("Update failed: " . $user->getError());
    }
    if (empty($target)) {
        $target = "members.php";
    }
    echo "<html><head><script language=javascript>alert(\"Your profile has been updated successfully\"); document.location=\"{$target}\";</script></head></html>";
    exit;
} else {
    $paddr = $user->getAddress('PERMANENT');
    $caddr = $user->getAddress('PRESENT');
    $oaddr = $user->getAddress('COMPANY');
    $work_types = XMEC::get_work_types();
}
?>


<HTML>
<HEAD>
<LINK rel=stylesheet href="style.css" type="text/css">
<script Language="JavaScript" src="jslibxmec.js">
</script>
<SCRIPT language="javascript">
function check()
{

 if (false == validate()) {
      //parent.self.location.href="xmec_createmem.htm";
Example #19
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 #20
0
 function backup($user = '******', $type = 'PRESENT')
 {
     $m = "{$type}|{$this->house_name}|{$this->street}|{$this->area}|";
     $m .= "{$this->city}|{$this->state}|{$this->country}|";
     $m .= "{$this->postal_code}|{$this->telephone_no}|";
     $m .= "{$this->visibility}";
     XMEC::log('ADDRESS_BACKUP', $user, $m);
     str_replace("\\'", "'", $m);
     str_replace("'", "\\'", $m);
     system("echo '{$this->id}|" . $m . "' >>l.og");
 }