Author: jfthomps
Date: Wed May  6 20:25:19 2009
New Revision: 772414

URL: http://svn.apache.org/viewvc?rev=772414&view=rev
Log:
VCL-135

removed references to NCSU/ncsu and a few short blocks of code that were 
specific to the production install at NCSU

updated some of the detailed description in the xmlrpcWrappers.php file to 
bring it up to date and remove references to NCSU

removed updateEXAMPLE1Groups from ldapauth.php, renamed updateEXAMPLE2Groups to 
be updateEXAMPLE1Groups, and removed references to EXAMPLE2 - all this was done 
because updateEXAMPLE1Groups called ldapUIDLookup which was an ldap function 
specific to ncsu

Modified:
    incubator/vcl/trunk/web/.ht-inc/Doxyfile
    incubator/vcl/trunk/web/.ht-inc/authentication.php
    incubator/vcl/trunk/web/.ht-inc/authmethods/ldapauth.php
    incubator/vcl/trunk/web/.ht-inc/doxyfile.xmlrpc
    incubator/vcl/trunk/web/.ht-inc/errors.php
    incubator/vcl/trunk/web/.ht-inc/help.php
    incubator/vcl/trunk/web/.ht-inc/requests.php
    incubator/vcl/trunk/web/.ht-inc/userpreferences.php
    incubator/vcl/trunk/web/.ht-inc/utils.php
    incubator/vcl/trunk/web/.ht-inc/xmlrpcWrappers.php
    incubator/vcl/trunk/web/images/textimage.php
    incubator/vcl/trunk/web/js/code.js
    incubator/vcl/trunk/web/shibauth/index.php

Modified: incubator/vcl/trunk/web/.ht-inc/Doxyfile
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/web/.ht-inc/Doxyfile?rev=772414&r1=772413&r2=772414&view=diff
==============================================================================
--- incubator/vcl/trunk/web/.ht-inc/Doxyfile (original)
+++ incubator/vcl/trunk/web/.ht-inc/Doxyfile Wed May  6 20:25:19 2009
@@ -80,14 +80,13 @@
 #---------------------------------------------------------------------------
 # configuration options related to the input files
 #---------------------------------------------------------------------------
-#INPUT                  = /home/jfthomps/locker/www/vcl/.ht-inc
-INPUT                  = /afs/eos/engrwww/vcl.ncsu/scheduling/.ht-inc
+INPUT                  = .
 FILE_PATTERNS          = *.php
 RECURSIVE              = yes
-EXCLUDE                = /afs/eos/engrwww/vcl.ncsu/scheduling/.ht-inc/jpgraph 
/afs/eos/engrwww/vcl.ncsu/scheduling/.ht-inc/jpgraph.old
+EXCLUDE                = jpgraph jpgraph.old
 EXCLUDE_SYMLINKS       = NO
 EXCLUDE_PATTERNS       = 
-EXAMPLE_PATH           = /afs/eos/engrwww/vcl.ncsu/scheduling/.ht-inc
+EXAMPLE_PATH           = .
 EXAMPLE_PATTERNS       = *
 EXAMPLE_RECURSIVE      = NO
 IMAGE_PATH             = 

Modified: incubator/vcl/trunk/web/.ht-inc/authentication.php
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/web/.ht-inc/authentication.php?rev=772414&r1=772413&r2=772414&view=diff
==============================================================================
--- incubator/vcl/trunk/web/.ht-inc/authentication.php (original)
+++ incubator/vcl/trunk/web/.ht-inc/authentication.php Wed May  6 20:25:19 2009
@@ -433,17 +433,7 @@
                else*/
                        setcookie("VCLSKIN", "DEFAULT", (time() + (SECINDAY * 
31)), "/", COOKIEDOMAIN);
                // redirect to main page
-               $tmp = explode('/', $_SERVER['HTTP_REFERER']);
-               if($tmp[2] != 'vcl.ncsu.edu' || 
-                  (array_key_exists(3, $tmp) && $tmp[3] != 'scheduling')) {
-                       array_shift($tmp);
-                       array_shift($tmp);
-                       array_shift($tmp);
-                       $rest = implode('/', $tmp);
-                       header("Location: https://vcl.ncsu.edu/$rest";);
-               }
-               else
-                       header("Location: " . BASEURL . SCRIPT);
+               header("Location: " . BASEURL . SCRIPT);
                dbDisconnect();
                exit;
        }
@@ -470,7 +460,7 @@
                else
                        setcookie("VCLAUTH", "{$cookie['data']}", 0, "/", 
COOKIEDOMAIN);
                //load main page
-               setcookie("VCLSKIN", "NCSU", (time() + (SECINDAY * 31)), "/", 
COOKIEDOMAIN);
+               setcookie("VCLSKIN", "default", (time() + (SECINDAY * 31)), 
"/", COOKIEDOMAIN);
                header("Location: " . BASEURL . SCRIPT);
                dbDisconnect();
                exit;
@@ -575,7 +565,7 @@
                                doQuery($query, 101);
                                updateGroups(array($nodemoid), $userid);
                                if(empty($skin)) {
-                                       $skin = 'ncsu';
+                                       $skin = 'default';
                                        require_once("themes/$skin/page.php");
                                }
                                $mode = 'expiredemouser';

Modified: incubator/vcl/trunk/web/.ht-inc/authmethods/ldapauth.php
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/web/.ht-inc/authmethods/ldapauth.php?rev=772414&r1=772413&r2=772414&view=diff
==============================================================================
--- incubator/vcl/trunk/web/.ht-inc/authmethods/ldapauth.php (original)
+++ incubator/vcl/trunk/web/.ht-inc/authmethods/ldapauth.php Wed May  6 
20:25:19 2009
@@ -269,9 +269,6 @@
                case 'EXAMPLE1':
                        updateEXAMPLE1Groups($user);
                        break;
-               case 'EXAMPLE2':
-                       updateEXAMPLE2Groups($user);
-                       break;
                default:
                        //TODO possibly add to a default group
        }
@@ -383,53 +380,13 @@
 ///
 /// \param $user - an array of user data
 ///
-/// \brief builds an array of nisNetgroups user is a member of and calls
-/// updateGroups
-///
-////////////////////////////////////////////////////////////////////////////////
-function updateEXAMPLE1Groups($user) {
-       $count = 0;
-       do {
-               if($count > 2)
-                       abort(35);
-               if($count > 0)
-                       sleep(1);
-               ldapUIDLookup($user['unityid'], $userData);
-               $count++;
-       } while(! array_key_exists("info", $userData) ||
-               ! array_key_exists("account", $userData["info"]) ||
-               ! array_key_exists("memberNisNetgroup", 
$userData["info"]["account"]));
-       $newusergroups = array();
-       if(! array_key_exists('info', $userData) ||
-          ! array_key_exists('account', $userData['info']) ||
-          ! array_key_exists('memberNisNetgroup', 
$userData['info']['account']))
-               return;
-       foreach($userData["info"]["account"]["memberNisNetgroup"] as $item) {
-               $tmpArr = explode(',', $item);
-               $tmpArr = explode('=', $tmpArr[0]);
-               if(! array_key_exists(1, $tmpArr)) {
-                       continue;
-               }
-               $grp = mysql_escape_string($tmpArr[1]);
-               array_push($newusergroups, getUserGroupID($grp, 
$user['affiliationid']));
-       }
-       $newusergroups = array_unique($newusergroups);
-       updateGroups($newusergroups, $user["id"]);
-}
-
-////////////////////////////////////////////////////////////////////////////////
-///
-/// \fn updateEXAMPLE2Groups($user)
-///
-/// \param $user - an array of user data
-///
 /// \brief builds an array of memberof groups user is a member of and calls
 /// updateGroups
 ///
 
////////////////////////////////////////////////////////////////////////////////
-function updateEXAMPLE2Groups($user) {
+function updateEXAMPLE1Groups($user) {
        global $authMechs;
-       $auth = $authMechs['EXAMPLE2 LDAP'];
+       $auth = $authMechs['EXAMPLE1 LDAP'];
        $ds = ldap_connect("ldaps://{$auth['server']}/");
        if(! $ds)
                return 0;
@@ -453,9 +410,9 @@
        if(! array_key_exists('memberof', $data[0]))
                return;
        for($i = 0; $i < $data[0]['memberof']['count']; $i++) {
-               if(preg_match('/^CN=(.+),OU=CourseRolls,DC=example2,DC=com/', 
$data[0]['memberof'][$i], $match) ||
-                  
preg_match('/^CN=(Students_Enrolled),OU=Students,DC=example2,DC=com$/', 
$data[0]['memberof'][$i], $match) ||
-                  preg_match('/^CN=(Staff),OU=IT,DC=example2,DC=com$/', 
$data[0]['memberof'][$i], $match))
+               if(preg_match('/^CN=(.+),OU=CourseRolls,DC=example1,DC=com/', 
$data[0]['memberof'][$i], $match) ||
+                  
preg_match('/^CN=(Students_Enrolled),OU=Students,DC=example1,DC=com$/', 
$data[0]['memberof'][$i], $match) ||
+                  preg_match('/^CN=(Staff),OU=IT,DC=example1,DC=com$/', 
$data[0]['memberof'][$i], $match))
                        array_push($newusergroups, getUserGroupID($match[1], 
$user['affiliationid']));
        }
        $newusergroups = array_unique($newusergroups);

Modified: incubator/vcl/trunk/web/.ht-inc/doxyfile.xmlrpc
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/web/.ht-inc/doxyfile.xmlrpc?rev=772414&r1=772413&r2=772414&view=diff
==============================================================================
--- incubator/vcl/trunk/web/.ht-inc/doxyfile.xmlrpc (original)
+++ incubator/vcl/trunk/web/.ht-inc/doxyfile.xmlrpc Wed May  6 20:25:19 2009
@@ -25,7 +25,7 @@
 ALWAYS_DETAILED_SEC    = NO
 INLINE_INHERITED_MEMB  = NO
 FULL_PATH_NAMES        = YES
-STRIP_FROM_PATH        = 
/afs/eos.ncsu.edu/lockers/people/j/jfthomps/www/vcl_rpc/.ht-inc/
+STRIP_FROM_PATH        = 
 STRIP_FROM_INC_PATH    = 
 SHORT_NAMES            = NO
 JAVADOC_AUTOBRIEF      = NO

Modified: incubator/vcl/trunk/web/.ht-inc/errors.php
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/web/.ht-inc/errors.php?rev=772414&r1=772413&r2=772414&view=diff
==============================================================================
--- incubator/vcl/trunk/web/.ht-inc/errors.php (original)
+++ incubator/vcl/trunk/web/.ht-inc/errors.php Wed May  6 20:25:19 2009
@@ -192,7 +192,7 @@
 
 $XMLRPCERRORS = array(
        1 => 'Internal error while processing your method call. If the '
-               . 'problem persists, please email vcl_h...@ncsu.edu for further 
'
+               . 'problem persists, please email ' . HELPEMAIL . ' for further 
'
                . 'assistance. In your email message, please include the time 
you '
                . 'made the call, the user you connected as, the method you '
                . 'called, and all passed in arguments.',

Modified: incubator/vcl/trunk/web/.ht-inc/help.php
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/web/.ht-inc/help.php?rev=772414&r1=772413&r2=772414&view=diff
==============================================================================
--- incubator/vcl/trunk/web/.ht-inc/help.php (original)
+++ incubator/vcl/trunk/web/.ht-inc/help.php Wed May  6 20:25:19 2009
@@ -54,12 +54,11 @@
                print "<H2>VCL Help</H2>\n";
        print "This form sends a request to the VCL support group.  Please 
provide ";
        print "as much information as possible.<br><br>\n";
-       if(! in_array('helpform', $noHTMLwrappers))
+       if(HELPFAQURL != '') {
                print "Please see our <a href=\"" . HELPFAQURL . "\">";
-       else
-               print "Please see our <a 
href=\"http://vcl.ncsu.edu/drupal/?q=faq\";>";
-       print "FAQ</a> Section before sending your request - it may be an easy 
";
-       print "fix!<br><br>\n";
+               print "FAQ</a> Section before sending your request - it may be 
an easy ";
+               print "fix!<br><br>\n";
+       }
        print "<FORM action=\"" . BASEURL . SCRIPT . "\" method=post>\n";
 
        print "<TABLE>\n";

Modified: incubator/vcl/trunk/web/.ht-inc/requests.php
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/web/.ht-inc/requests.php?rev=772414&r1=772413&r2=772414&view=diff
==============================================================================
--- incubator/vcl/trunk/web/.ht-inc/requests.php (original)
+++ incubator/vcl/trunk/web/.ht-inc/requests.php Wed May  6 20:25:19 2009
@@ -2344,14 +2344,12 @@
        if($submitErr) {
                $data = processRequestInput(0);
        }
-       // NCSU code
        $groupid = getUserGroupID('Specify End Time', 1);
        $members = getUserGroupMembers($groupid);
        if(array_key_exists($user['id'], $members))
                $openend = 1;
        else
                $openend = 0;
-       // end NCSU code
        $unixstart = datetimeToUnix($request["start"]);
        $unixend = datetimeToUnix($request["end"]);
        $maxtimes = getUserMaxTimes("initialmaxtime");
@@ -3228,18 +3226,12 @@
                           $meridian=NULL, $length=60, $oneline=0, $nolength=0) 
{
        global $user;
        $enddate = processInputVar("enddate", ARG_STRING);
-       // NCSU code
        $groupid = getUserGroupID('Specify End Time', 1);
        $members = getUserGroupMembers($groupid);
        if(array_key_exists($user['id'], $members))
                $openend = 1;
        else
                $openend = 0;
-       // end NCSU code
-       /*if($user['adminlevel'] == 'developer')
-               $openend = 1;
-       else
-               $openend = 0;*/
        $days = array();
        $inputday = "";
        for($cur = time(), $end = $cur + DAYSAHEAD * SECINDAY; 
@@ -3338,46 +3330,6 @@
                $requestid = getContinuationVar('requestid', 0);
        else
                $requestid = processInputVar("requestid", ARG_NUMERIC);
-       $skipwarning = getContinuationVar('skipwarning', 0);
-       # check for using ncsu-guest addr
-       if(! $skipwarning) {
-               $iparr = explode('.', $remoteIP);
-               if($iparr[0] == 204 && $iparr[1] == 84 &&
-                       (($iparr[2] == 244) ||
-                       ($iparr[2] == 245) ||
-                       ($iparr[2] == 246 && $iparr[3] < 128))) {
-                       print "<H2 align=center>Connect!</H2>\n";
-                       print "<big><strong>WARNING:</strong> It appears as 
though you are ";
-                       print "connected to an <strong>ncsu-guest</strong> 
wireless access ";
-                       print "point. If this is true, you will not be able to 
connect to ";
-                       print "your reservation because ncsu-guest only allows 
web traffic. ";
-                       print "You need to switch to using 
<strong>ncsu</strong> as your ";
-                       print "wireless access point. If you are sure you are 
not using ";
-                       print "ncsu-guest and want to try to connect anyway, 
you may select ";
-                       print "<strong>Ignore this Warning</strong> to continue 
to the ";
-                       print "normal <strong>Connect!</strong> 
page.</big><br><br>\n";
-                       $cdata = array('requestid' => $requestid,
-                                                               'skipwarning' 
=> 1);
-                       $cont = addContinuationsEntry('connectRequest', $cdata);
-                       print "<table summary=\"\">\n";
-                       print "  <tr>\n";
-                       print "    <td>\n";
-                       print "      <FORM action=\"" . BASEURL . SCRIPT . "\" 
method=post>\n";
-                       print "      <INPUT type=hidden name=continuation 
value=\"$cont\">\n";
-                       print "      <INPUT type=submit value=\"Ignore this 
Warning\">\n";
-                       print "      </FORM>\n";
-                       print "    </td>\n";
-                       print "    <td>\n";
-                       print "      <FORM action=\"" . BASEURL . SCRIPT . "\" 
method=post>\n";
-                       print "      <INPUT type=hidden name=mode 
value=viewRequests>\n";
-                       print "      <INPUT type=submit value=\"Cancel\">\n";
-                       print "      </FORM>\n";
-                       print "    </td>\n";
-                       print "  </tr>\n";
-                       print "</table>\n";
-                       return;
-               }
-       }
        $requestData = getRequestInfo($requestid);
        if($requestData['reservations'][0]['remoteIP'] != $remoteIP) {
                $setback = unixToDatetime(time() - 600);
@@ -3401,8 +3353,7 @@
                $passwd = $requestData["reservations"][0]["password"];
                if(eregi("windows", $osname)) {
                        print "You will need to use a ";
-                       print "<a 
href=\"http://vcl.ncsu.edu/help/connecting-vcl/how-connect-vcl\";>Remote ";
-                       print "Desktop program</a> to connect to the ";
+                       print "Remote Desktop program to connect to the ";
                        print "system. If you did not click on the 
<b>Connect!</b> button from ";
                        print "the computer you will be using to access the VCL 
system, you ";
                        print "will need to cancel this reservation, request a 
new one, and ";
@@ -3453,17 +3404,13 @@
                        print "      <INPUT type=submit value=\"Get RDP 
File\">\n";
                        print "      </FORM>\n";
                        print "    </TD>\n";
-                       print "    <TD><a 
href=\"http://vcl.ncsu.edu/help/connecting-vcl/";;
-                       print "remote-desktop/what-rdp-file\">What is an RDP 
file?</a></TD>\n";
                        print "  </TR>\n";
                        print "</table>\n";
                }
                else {
                        print "You will need to have an ";
-                       print "<a 
href=\"http://vcl.ncsu.edu/help/connecting-vcl/how-connect-vcl#sshx\";>X server";
-                       print "</a> running on your local computer and use an ";
-                       print "<a 
href=\"http://vcl.ncsu.edu/help/connecting-vcl/how-connect-vcl#sshx\";>ssh ";
-                       print "client</a> to connect to the system. If you did 
not ";
+                       print "X server running on your local computer and use 
an ";
+                       print "ssh client to connect to the system. If you did 
not ";
                        print "click on the <b>Connect!</b> button from the 
computer you will ";
                        print "need to cancel this reservation, request a new 
one, and ";
                        print "make sure you click the 
<strong>Connect!</strong> button in ";
@@ -3490,8 +3437,7 @@
                        }
                        print "<strong><big>NOTE:</big> You cannot use the 
Windows Remote ";
                        print "Desktop Connection to connect to this computer. 
You must use an ";
-                       print "<a 
href=\"http://vcl.ncsu.edu/help/connecting-vcl/how-connect-vcl#sshx\";>";
-                       print "ssh client</a>.</strong>\n";
+                       print "ssh client.</strong>\n";
                        /*if(eregi("windows", $_SERVER["HTTP_USER_AGENT"])) {
                                print "<br><br><h3>NEW!</h3>\n";
                                print "Connect to the server using a java 
applet:<br>\n";
@@ -3505,11 +3451,9 @@
        }
        else {
                print "You will need an ";
-               print "<a 
href=\"http://vcl.ncsu.edu/help/connecting-vcl/how-connect-vcl#sshx\";>ssh ";
-               print "client</a> to connect to any unix systems.<br>\n";
+               print "ssh client to connect to any unix systems.<br>\n";
                print "You will need a ";
-               print "<a 
href=\"http://vcl.ncsu.edu/help/connecting-vcl/how-connect-vcl\";>Remote ";
-               print "Desktop program</a> to connect to any windows 
systems.<br><br>\n";
+               print "Remote Desktop program</a> to connect to any windows 
systems.<br><br>\n";
                print "Use the following information when you are ready to 
connect:<br>\n";
                $total = count($requestData["reservations"]);
                $count = 0;

Modified: incubator/vcl/trunk/web/.ht-inc/userpreferences.php
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/web/.ht-inc/userpreferences.php?rev=772414&r1=772413&r2=772414&view=diff
==============================================================================
--- incubator/vcl/trunk/web/.ht-inc/userpreferences.php (original)
+++ incubator/vcl/trunk/web/.ht-inc/userpreferences.php Wed May  6 20:25:19 2009
@@ -53,14 +53,8 @@
        }
 
        $adminleveldeveloper = 0;
-       if(array_key_exists('WRAP_USERID', $_SERVER)) {
-               $testid = getAffiliationID("NCSU");
-               if(! empty($testid)) {
-                       $testuser = 
getUserInfo("{$_SERVER['WRAP_USERID']...@ncsu");
-                       if($testuser['adminlevelid'] == ADMIN_DEVELOPER)
-                               $adminleveldeveloper = 1;
-               }
-       }
+       if($user['adminlevelid'] == ADMIN_DEVELOPER)
+               $adminleveldeveloper = 1;
 
 
        print "<H2 align=center>User Preferences</H2>\n";

Modified: incubator/vcl/trunk/web/.ht-inc/utils.php
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/web/.ht-inc/utils.php?rev=772414&r1=772413&r2=772414&view=diff
==============================================================================
--- incubator/vcl/trunk/web/.ht-inc/utils.php (original)
+++ incubator/vcl/trunk/web/.ht-inc/utils.php Wed May  6 20:25:19 2009
@@ -140,22 +140,9 @@
        # the user table corresponding to the user you want
        # logged in
 
+       # start auth check
        $authed = 0;
-       # check for being logged in to WRAP or ITECSAUTH
-       if/*(array_key_exists("WRAP_AFFIL", $_SERVER) && 
-          $_SERVER["WRAP_AFFIL"] == "ncsu.edu" &&
-          $_SERVER['WRAP_USERID'] != 'Guest') {
-               $authed = 1;
-               $userid = "{$_SERVER["WRAP_USERID"]...@ncsu";
-       }
-       elseif(array_key_exists("ITECSAUTH", $_COOKIE)) {
-               $authdata = authUser();
-               if(! ($error = getAuthError())) {
-                       $authed = 1;
-                       $userid = "{$authdata["email"]...@itecs";
-               }
-       }
-       elseif*/(array_key_exists("VCLAUTH", $_COOKIE)) {
+       if(array_key_exists("VCLAUTH", $_COOKIE)) {
                $userid = readAuthCookie();
                if(! is_null($userid))
                        $authed = 1;
@@ -375,8 +362,6 @@
                elseif($apiver == 2) {
                        $authtype = "";
                        foreach($authMechs as $key => $authmech) {
-                               /*if($key == "NCSU WRAP")
-                                       continue;*/
                                if($authmech['affiliationid'] == 
$user['affiliationid']) {
                                        $authtype = $key;
                                        break;
@@ -446,70 +431,12 @@
                        exit;
                }
        }
-       # this protects against an attacker submitting data without coming from
-       # our index.php page
        elseif(! empty($mode)) {
-               /*if(empty($_SERVER["HTTP_REFERER"])) {
-                       # when firefox auto-reloads a page, it doesn't set 
HTTP_REFERER
-                       # since we are auto-reloading the 'Current 
Reservations' page if
-                       # there is a pending request, we can't abort
-                       if(in_array($mode, $actions['entry']) ||
-                          $mode == "viewRequests" ||
-                          $mode == "statgraphday" ||
-                          $mode == "statgraphdayconcuruser" ||
-                          $mode == "statgraphdayconcurblade" ||
-                          $mode == "statgraphhour" ||
-                          $mode == "selectauth" ||
-                          $mode == "selectNode" ||
-                          $mode == "AJsubmitAddUserPriv" ||
-                               $mode == "AJsubmitAddUserGroupPriv" ||
-                          $mode == "AJchangeUserPrivs" ||
-                          $mode == "AJchangeUserGroupPrivs" ||
-                          $mode == "AJsubmitAddChildNode" ||
-                          $mode == "AJsubmitDeleteNode" ||
-                          $mode == "AJupdateWaitTime" ||
-                          $mode == "clearCache" ||
-                          $mode == "jsonImageInformation" ||
-                          $mode == "helpform" ||
-                          $mode == "auth") {
-                               return;
-                       }
-                       $mode = "";
-                       $actionFunction = "main";
-                       #$user["adminlevel"] = "none";
-                       #$viewmode = ADMIN_NONE;
-                       #abort(20);
-                       return;
-               }
-               $urlArray = explode('?', $_SERVER["HTTP_REFERER"]);
-               #print "urlArray[0] - " . $urlArray[0] . "<BR>\n";
-               #print "correct URL - " . BASEURL . "/<br>\n";
-               if(($urlArray[0] != BASEURL . SCRIPT) &&
-                  ($urlArray[0] != BASEURL . "/") &&
-                  ($urlArray[0] != 
"https://webauth.ncsu.edu/wrap-bin/was16.cgi";) &&
-                  ($urlArray[0] != "http://vcl.ncsu.edu/index.php";) &&
-                  ($urlArray[0] != "http://vcl.ncsu.edu/";) &&
-                  ($urlArray[0] != 
"http://vcl.ncsu.edu/site/pages/help/vcl-help"; &&
-                  $urlArray[0] != 
"http://vcl.ncsu.edu/site/pages/help/default"; &&
-                  $urlArray[0] != 
"http://vcl.ncsu.edu/site/pages/default/default"; &&
-                  $urlArray[0] != "http://vcl.ncsu.edu/site.php"; &&
-                  $urlArray[0] != "http://vcl.ncsu.edu/site"; &&
-                  $urlArray[0] != "https://vcl.ncsu.edu/"; &&
-                  $urlArray[0] != 
"https://vcl.ncsu.edu/email-vcl-help-support"; &&
-                  $urlArray[0] != "http://vcl.ncsu.edu/email-vcl-help-support"; 
&&
-                  $mode == "helpform") &&
-                  (($urlArray[0] != "http://vcl.ncsu.edu/site"; &&
-                  $urlArray[0] != 
"http://vcl.ncsu.edu/site/pages/default/default"; &&
-                  $urlArray[0] != "http://vcl.ncsu.edu/site/index/default";) ||
-                  $mode != "viewRequests")) {*/
                if(! in_array($mode, $actions['entry']) &&
                   ! $inContinuation) {
                        $mode = "main";
                        $actionFunction = "main";
                        return;
-                       #$user["adminlevel"] = "none";
-                       #$viewmode = ADMIN_NONE;
-                       #abort(20);
           }
                else {
                        if(! $inContinuation) {
@@ -856,248 +783,6 @@
 
 
////////////////////////////////////////////////////////////////////////////////
 ///
-/// \fn ldapUIDLookup($uid, &$userInfo, $doMerge)
-///
-/// \param $uid - userid to lookup
-/// \param $userInfo - the following fields get populated if they are received
-/// from the LDAP server:\n
-/// \b uid - userid\n
-/// \b info->has_account - TRUE/FALSE\n
-/// \b info->is_employee - TRUE/FALSE\n
-/// \b info->is_student - TRUE/FALSE\n
-/// \b cn - full name\n
-/// \b sn - surname\n
-/// \b employeeType - SPA/EPA/GRAD/??\n
-/// \b givenName - first name\n
-/// \b initials \n
-/// \b title \n
-/// \b ncsuPreferredName \n
-/// \b displayName \n
-/// \b employeeNumber \n
-/// \b departmentNumber \n
-/// \b ncsuAffiliation - ??\n
-/// \b mail - preferred email address\n
-/// \b registeredAddress \n
-/// \b telephoneNumber \n
-/// \b facsimileTelephoneNumber \n
-/// \b ou - department \n
-/// \b gecos - ??\n
-/// \b loginShell - preferred unix shell \n
-/// \b uidNumber - numeric unix id \n
-/// \b gidNumber - numeric unix groud id \n
-/// \b homeDirectory \n
-/// \b mailHost \n
-/// \b ncsuMUAprotocol - POP/IMAP (not current??)\n
-/// \b memberNisNetgroup - array of hesiod groups\n
-/// \param $doMerge - (optional) ??
-///
-/// \return TRUE or FALSE
-///
-/// \brief looks up a userid on the LDAP server, populates $userInfo, returns
-/// TRUE or FALSE
-///
-////////////////////////////////////////////////////////////////////////////////
-function ldapUIDLookup($uid, &$userInfo, $doMerge=TRUE) {
-       global $ldaprdn, $ldappass, $error;
-       $userInfo = array("uid" => "",
-                         "cn" => "",
-                         "sn" => "",
-                         "employeeType" => "",
-                         "givenName" => "",
-                         "initials" => "",
-                         "title" => "",
-                         "ncsuPreferredName" => "",
-                         "displayName" => "",
-                         "employeeNumber" => "",
-                         "departmentNumber" => "",
-                         "ncsuAffiliation" => "",
-                         "mail" => "",
-                         "registeredAddress" => "",
-                         "telephoneNumber" => "",
-                         "facsimileTelephoneNumber" => "",
-                         "ou" => "",
-                         "gecos" => "",
-                         "loginShell" => "",
-                         "uidNumber" => "",
-                         "gidNumber" => "",
-                         "homeDirectory" => "",
-                         "mailHost" => "",
-                         "ncsuMUAprotocol" => "",
-                         "memberNisNetgroup" => array());
-       
-       $ldapConnect = ldap_connect("ldaps://ldap.ncsu.edu/");
-       if(!$ldapConnect) {
-               $error['op'] = "ldapUIDLookup";
-               $error['shortmsg'] = "Could not connect to LDAP server: ";
-               $error['shortmsg'] .= "ldap.ncsu.edu"; 
-               return FALSE;
-       }
-
-       ldap_set_option($ldapConnect, LDAP_OPT_REFERRALS, 0);
-       $result = ldap_bind($ldapConnect, $ldaprdn, $ldappass);
-       if(!$result) {
-               $error['op'] = "ldapUIDLookup";
-               $error['shortmsg'] = "Could not create LDAP binding";   
-               $error['syscode'] = ldap_errno($ldapConnect);
-               $error['sysmsg'] = ldap_err2str($error['syscode']);     
-               ldap_close($ldapConnect);
-               return FALSE;
-       }
-
-       $context = "dc=ncsu,dc=edu";
-       $searchstring = "uid=".$uid;
-       $searchResult = 
-          ldap_search($ldapConnect,$context,$searchstring,array("*","+"));
-       if(!$searchResult) {
-               $error['op'] = "ldapUIDLookup";
-               $error['shortmsg'] = "Could not execute LDAP search ";
-               $error['shortmsg'] .= "($context => $searchstring)";
-               $error['context'] = $context;
-               $error['search'] = $searchstring;
-               $error['syscode'] = ldap_errno($ldapConnect);
-               $error['sysmsg'] = ldap_err2str($error['syscode']);
-               ldap_close($ldapConnect);
-               return FALSE;
-       }
-
-       if(ldap_count_entries($ldapConnect,$searchResult) == 0) {
-               $error['op'] = "ldapUIDLookup";
-               $error['shortmsg'] = "Specified uid: $uid not found";
-               ldap_close($ldapConnect);
-               return FALSE;
-       }
-
-
-       // basic information
-       $haveuser = FALSE;      
-       $userInfo['uid'] = $uid;
-       $userInfo['info']['has_account'] = FALSE;
-       $accountInfo = array();
-       $userInfo['info']['is_employee'] = FALSE;
-       $employeeInfo = array();
-       $userInfo['info']['is_student'] = FALSE;
-       $studentInfo = array();
-
-       for($entryID = ldap_first_entry($ldapConnect,$searchResult);
-               $entryID != FALSE;
-               $entryID = ldap_next_entry($ldapConnect,$entryID)) {
-               $thisEntry = array();
-               $thisDN = '';
-               $thisDN = ldap_get_dn($ldapConnect,$entryID);
-               $thisEntry = ldap_get_attributes($ldapConnect,$entryID);
-
-               if(!(isset($thisEntry))) continue;
-
-               // parse dn
-               $dnarray = explode(',',$thisDN);
-               $checkou = $dnarray[1];
-               switch($checkou) {
-
-                       case "ou=accounts":
-                               $haveuser = TRUE;
-                               $userInfo['info']['has_account'] = TRUE;
-                               $dataInfo = &$accountInfo;
-                               break;
-
-                       case "ou=employees":
-                               $haveuser = TRUE;
-                               $userInfo['info']['is_employee'] = TRUE;
-                               $dataInfo = &$employeeInfo;
-                               break;  
-
-                       case "ou=students":
-                               $haveuser = TRUE;
-                               $userInfo['info']['is_student'] = TRUE;
-                               $dataInfo = &$studentInfo;
-                               break;
-
-                       // not dealing with a group/printer/host/other
-                       // somehow (don't know how) keyed by identifier 
uid=$uid...
-                       default:
-                               continue 2;
-               }
-
-               foreach($thisEntry as $attribute => $value) {
-                       if(!(is_array($value))) continue;
-                       if($attribute == "uid") continue;
-                       if($attribute == "count") continue;
-
-                       if($value['count'] > 1) {
-                               $dataInfo[$attribute] = $value;
-                               unset($dataInfo[$attribute]['count']);
-                       }
-                       else {
-                               $dataInfo[$attribute] = $value[0];      
-                       }
-               }       
-       }
-
-       if(!($haveuser)) {
-               $error['op'] = "ldapUIDLookup";
-               $error['shortmsg'] = "Specified uid: $uid is not a user 
account";
-               ldap_close($ldapConnect);
-               return FALSE;
-       }
-
-       // merge information student, then employee, then account
-
-       if($userInfo['info']['is_student']) {
-               if($doMerge) $userInfo = array_merge($userInfo,$studentInfo);
-               $userInfo['info']['student'] = $studentInfo;
-       }
-
-       if($userInfo['info']['is_employee']) {
-               if($doMerge) $userInfo = array_merge($userInfo,$employeeInfo);
-               $userInfo['info']['employee'] = $employeeInfo;
-       }
-
-       if($userInfo['info']['has_account']) {
-               if($doMerge) $userInfo = array_merge($userInfo,$accountInfo);
-               $userInfo['info']['account'] = $accountInfo;
-       }
-
-       if($doMerge) {
-               // merged values we don't care about:
-               $noMergeAttribs = array('objectClass',
-                                       'structuralObjectClass',
-                                       'entryUUID',
-                                       'creatorsName',
-                                       'createTimestamp',
-                                       'modifyTimestamp',
-                                       'subschemaSubentry',
-                                       'hasSubordinates',
-                                       'modifiersName',
-                                       'entryCSN');
-
-               foreach($noMergeAttribs as $attribute) {
-                       unset($userInfo[$attribute]);
-               }
-       }
-
-       if(! $userInfo["info"]["is_employee"] && ! 
$userInfo["info"]["is_student"] &&
-          $userInfo["info"]["has_account"]) {
-               if(array_key_exists("gecos", $userInfo["info"]["account"])) {
-                       $name = explode(' ', 
$userInfo["info"]["account"]["gecos"]);
-                       if(count($name) == 3) {
-                               $userInfo["givenName"] = $name[0];
-                               $userInfo["sn"] = $name[2];
-                       }
-                       elseif(count($name) == 2) {
-                               $userInfo["givenName"] = $name[0];
-                               $userInfo["sn"] = $name[1];
-                       }
-                       elseif(count($name) == 1) {
-                               $userInfo["sn"] = $name[0];
-                       }
-               }
-               $userInfo["mail"] = $userInfo["uid"] . "@ncsu.edu";
-       }
-
-       return TRUE;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-///
 /// \fn validateUserid($loginid)
 ///
 /// \param $loginid - a submitted loginid
@@ -7403,9 +7088,6 @@
                else
                        return 0;
        }
-       if(ereg('\.ncsu\.edu$', $a)) {
-               return compareDashedNumbers($a, $b);
-       }
        return strcasecmp($a, $b);
 }
 
@@ -8489,29 +8171,10 @@
        global $shibauthed;
        $setwrapreferer = processInputVar('am', ARG_NUMERIC, 0);
        if(! $authed && $mode == "auth") {
-               /*if($oldmode != "auth" && $oldmode != "" && 
array_key_exists('mode', $_GET)) {
-                       $cookieHeaderString = "WRAP_REFERER=" . BASEURL . 
SCRIPT . "?mode=$oldmode; path=/; domain=" . COOKIEDOMAIN;
-                       $itecscookie = BASEURL . SCRIPT . "?mode=$oldmode";
-               }
-               else {
-                       $cookieHeaderString = "WRAP_REFERER=" . BASEURL . "; 
path=/; domain=" . COOKIEDOMAIN;
-                       $itecscookie = BASEURL;
-               }
-               header("Set-Cookie: $cookieHeaderString");
-               setcookie("ITECSAUTH_RETURN", "$itecscookie", 0, "/", 
COOKIEDOMAIN);
-               setcookie("ITECSAUTH_CSS", "vcl.css", 0, "/", COOKIEDOMAIN);*/
                header("Location: " . BASEURL . SCRIPT . "?mode=selectauth");
                dbDisconnect();
                exit;
        }
-       elseif(! $authed && $mode == 'selectauth' && $setwrapreferer == 1) {
-               $tmp = explode('/', $_SERVER['HTTP_REFERER']);
-               if($tmp[2] == 'vcl.ncsu.edu')
-                       $cookieHeaderString = 
"WRAP_REFERER={$_SERVER['HTTP_REFERER']}; path=/; domain=" . COOKIEDOMAIN;
-               else
-                       $cookieHeaderString = 
"WRAP_REFERER=https://vcl.ncsu.edu/; path=/; domain=" . COOKIEDOMAIN;
-               header("Set-Cookie: $cookieHeaderString");
-       }
        switch($mode) {
                case 'logout':
                        if($shibauthed) {
@@ -8568,18 +8231,6 @@
        }
        if($mode == "submitviewmode") {
                $expire = time() + 31536000; //expire in 1 year
-               /*if(array_key_exists('WRAP_USERID', $_SERVER)) {
-                       $testuser = 
getUserInfo("{$_SERVER['WRAP_USERID']...@ncsu");
-                       if($testuser['adminlevelid'] == ADMIN_DEVELOPER) {
-                               $viewasuser = processInputVar("viewasuser", 
ARG_STRING, $_SERVER['WRAP_USERID']);
-                               if(validateUserid($viewasuser)) {
-                                       if($viewasuser == 
$_SERVER['WRAP_USERID'])
-                                               setcookie("VCLTESTUSER", "", 
time() - 10, "/", COOKIEDOMAIN);
-                                       else
-                                               setcookie("VCLTESTUSER", 
$viewasuser, $expire, "/", COOKIEDOMAIN);
-                               }
-                       }
-               }*/
                $newviewmode = processInputVar("viewmode", ARG_NUMERIC);
                if(! empty($newviewmode) && $newviewmode <= 
$user['adminlevelid'])
                        setcookie("VCLVIEWMODE", $newviewmode, $expire, "/", 
COOKIEDOMAIN);

Modified: incubator/vcl/trunk/web/.ht-inc/xmlrpcWrappers.php
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/web/.ht-inc/xmlrpcWrappers.php?rev=772414&r1=772413&r2=772414&view=diff
==============================================================================
--- incubator/vcl/trunk/web/.ht-inc/xmlrpcWrappers.php (original)
+++ incubator/vcl/trunk/web/.ht-inc/xmlrpcWrappers.php Wed May  6 20:25:19 2009
@@ -24,8 +24,13 @@
  * There is one function called \b XMLRPCtest() that can be used during 
  * initial development to get started without actually making a request.\n
  * \n
- * The URL you will use to submit RPC calls is\n\n
- * https://vcl.ncsu.edu/scheduling/index.php?mode=xmlrpccall\n\n
+ * The URL you will use to submit RPC calls is the URL for your VCL site
+ * followed by\n\n
+ * index.php?mode=xmlrpccall\n\n
+ * for example if the URL for your VCL site is\n\n
+ * https://vcl.mysite.org/vcl/\n\n
+ * the RPC URL would be\n\n
+ * https://vcl.mysite.org/vcl/index.php?mode=xmlrpccall\n\n
  * Your application must connect using HTTPS.\n\n
  * Internal to the VCL code, "Reservations" are called "Requests"; therefore,
  * "request" is used instead of "reservation" in this documentation and in the
@@ -38,14 +43,15 @@
  * send:\n
  * \b X-User - the userid you would use to log in to the VCL site, followed
  * by the at sign (@), followed by your affiliation\n
- * example: myuser...@ncsu -
- * currently, you need to  contact vcl_h...@ncsu.edu to find out your
- * affiliation, but in the future there will be an API method of obtaining
- * this\n
+ * example: myuser...@ncsu\n
+ * You can obtain a list of the affiliations by using the XMLRPCaffiliations()
+ * call\n\n
  * \b X-Pass - the password you would use to log in to the VCL site\n
  * \n
  * There is one other additional HTTP header you must send:\n
  * \b X-APIVERSION - set this to 2\n\n
+ * The X-User and X-Pass HTTP headers do not need to be passed to call the
+ * XMLRPCaffiliations() function.
  * 
  * <h2>API Version 1</h2>
  * \b NOTICE: API version 1 will probably be removed in VCL 2.2.  If you are
@@ -53,8 +59,6 @@
  * This version is being phased out in favor of version 2. Documentation is
  * provided for those currently using version 1 who are not ready to switch
  * to using version 2.\n\n
- * To connect to VCL with XML RPC, you will need to obtain a key. Contact
- * vcl_h...@ncsu.edu to get one.\n
  * 
  * Authentication is handled by 2 additional HTTP headers you will need to
  * send:\n
@@ -75,7 +79,9 @@
 /// \b id - id of the affiliation\n
 /// \b name - name of the affiliation
 ///
-/// \brief gets all of the affilations for which users can log in to VCL
+/// \brief gets all of the affilations for which users can log in to VCL\n
+/// \b NOTE: This is the only function available for which the X-User and 
X-Pass
+/// HTTP headers do not need to be passed
 ///
 
////////////////////////////////////////////////////////////////////////////////
 function XMLRPCaffiliations() {

Modified: incubator/vcl/trunk/web/images/textimage.php
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/web/images/textimage.php?rev=772414&r1=772413&r2=772414&view=diff
==============================================================================
--- incubator/vcl/trunk/web/images/textimage.php (original)
+++ incubator/vcl/trunk/web/images/textimage.php Wed May  6 20:25:19 2009
@@ -16,9 +16,6 @@
   limitations under the License.
 */
 
-// most of this was taken from Troy's documentation at
-// http://sysadm.eos.ncsu.edu/site/pages/phpdev/gd-graphics
-
 $face = "fonts/arialbd.ttf";
 
 function vectordist($a, $b){

Modified: incubator/vcl/trunk/web/js/code.js
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/web/js/code.js?rev=772414&r1=772413&r2=772414&view=diff
==============================================================================
--- incubator/vcl/trunk/web/js/code.js (original)
+++ incubator/vcl/trunk/web/js/code.js Wed May  6 20:25:19 2009
@@ -246,8 +246,8 @@
        if(data.match(regex)) {
                var mesg = 'A minor error has occurred. It is probably safe to 
' +
                           'ignore. However, if you keep getting this message 
and ' +
-                          'are unable to use VCL, you may contact 
vcl_h...@ncsu.edu ' +
-                          'for further assistance.';
+                          'are unable to use VCL, you may contact the ' +
+                          'administrators of this site for further 
assistance.';
                alert(mesg);
                var d = {mode: 'errorrpt',
                         data: data};

Modified: incubator/vcl/trunk/web/shibauth/index.php
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/web/shibauth/index.php?rev=772414&r1=772413&r2=772414&view=diff
==============================================================================
--- incubator/vcl/trunk/web/shibauth/index.php (original)
+++ incubator/vcl/trunk/web/shibauth/index.php Wed May  6 20:25:19 2009
@@ -199,7 +199,7 @@
                setcookie("VCLSKIN", $skin, (time() + (SECINDAY * 31)), "/", 
COOKIEDOMAIN);
                break;
        default:
-               setcookie("VCLSKIN", "NCSU", (time() + (SECINDAY * 31)), "/", 
COOKIEDOMAIN);
+               setcookie("VCLSKIN", "default", (time() + (SECINDAY * 31)), 
"/", COOKIEDOMAIN);
 }
 header("Location: " . BASEURL . "/");
 dbDisconnect();


Reply via email to