....................................../////.===Shadow-Here===./////................................................ > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < ------------------------------------------------------------------------------------------------------------------- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// RIFF¤ WEBPVP8 ˜ ðÑ *ôô>‘HŸK¥¤"§£±¨àð enü¹%½_F‘åè¿2ºQú³íªú`N¿­3ÿƒügµJžaÿ¯ÿ°~¼ÎùnúîÞÖô•òíôÁÉß®Sm¥Ü/ ‡ó˜f£Ùà<˜„xëJ¢Ù€SO3x<ªÔ©4¿+ç¶A`q@Ì“Úñè™ÍÿJÌ´ª-˜ÆtÊÛL]Ïq*‘Ý”ì#ŸÌÏãY]@ê`¿ /ªfkØB4·®£ó z—Üw¥Pxù–ÞLШKÇN¾AkÙTf½è'‰g gÆv›Øuh~ a˜Z— ïj*á¥t d£“uÒ ¨`K˜¹ßþ]b>˜]_ÏÔ6W—è2r4x•íÖ…"ƒÖNîä!¦å Ú}ýxGøÌ —@ ;ÆÚŠ=ɾ1ý8lªË¥ô ^yf®Œ¢u&2©nÙÇ›ñÂñŒ³ aPo['½»øFùà­+4ê“$!lövlüÞ=;N®3ð‚õ›DÉKòÞ>ÄÍ ¥ˆuߤ#ˆ$6ù™¥îЇy’ÍB¼ çxÛ;X"WL£R÷͝*ó-¶Zu}º.s¸sšXqù–DþÿvªhüïwyŸ ¯é³lÀ:KCûÄ£Ëá\…­ ~—ýóî ¼ûûÜTÓüÇy…ŽÆvc»¾×U ñ¸žþоP÷¦ó:Ò¨¨5;Ð#&#ÖúñläÿÁœ GxÉ­/ñ‡áQðìYÉtÒw޼GÔ´zàÒò ð*ëzƒ•4~H]Ø‹f ñÓÈñ`NåWçs'ÆÏW^ø¹!XžµmQ5ÃËoLœÎ: ÞËÍ¥J ù…î èo£ßPÎñ¶ž8.Œ]ʵ~5›ÙË-ù*8ÙÖß±~ ©¹rÓê‚j¶d¸{^Q'˜±Crß ÚH—#¥¥QlÀ×ëã‡DÜ«èî þ&Çæžî;ŽÏºò6ÒLÃXy&ZŒ'j‚¢Ù€IßÚù+–MGi‰*jE€‘JcÜ ÓÌ EÏÚj]o˜ Þr <¾U ûŪæÍ/šÝH¥˜b”¼ ÁñßX GP›ï2›4WŠÏà×£…íÓk†¦H·ÅíMh–*nó÷à]ÁjCº€b7<ب‹¨5車bp2:Á[UªM„QŒçiNMa#<5›áËó¸HýÊ"…×Éw¹¦ì2º–x<›»a±¸3Weü®FÝ⑱ö–î–³|LPÈ~çð~Çå‡|º kD¢µÏàÆAI %1À% ¹Ò – ”ϝS¦‰4&¶£°à Öý”û_Ò Áw°A«Å€?mÇÛgHÉ/8)á¾ÛìáöŽP í¨PŸNÙµº¦‡§Ùš"ÿ«>+ªÕ`Ê÷‡‚ß Õû˜þãÇ-PÍ.¾XV‘€ dÜ"þ4¹ ±Oú‘©t¥¦FªÄÃÄ•b‚znýu½—#cDs˜ÃiÑOˆñ×QO=*IAÊ,¶ŽZƒ;‡wøXè%EÐk:F±Ú” .Ѽ+Áu&Ç`."pÈÉw o&¿dE6‘’EqTuK@Ì¥ã™À(Êk(h‰,H}RÀIXÛš3µ1©_OqÚÒJAñ$ÊÙÜ;D3çŒ[þùœh¬Ã³™ö6ç†NY".Ú‰ï[ªŸŒ '²Ð öø_¨ÂÉ9ué¶³ÒŠõTàîMØ#û¯gN‡bÙ놚X„ö …ÉeüÌ^J ‹€.œ$Æ)βÄeæW#óüßĺŸ€ ÀzwV 9oä»f4V*uB «Ë†¹ì¯žR霓æHXa=&“I4K;¯ç‹h×·"UŠ~<•╪Vêª&ÍSÃÆÅ?ÔqÎ*mTM ˜›µwêd#[C¡©§‘D<©àb†–ÁœøvH/,í:¯( ²£|4-„Æövv„Yͼ™^Á$ˆ„¢Û[6yB.åH*V¨æ?$=˜Ñ€•ñ·­(VlŸ‘ nÀt8W÷´Bûba?q9ú¶Xƒl«ÿ\ù¶’þòUÐj/õ¢Ìµ³g$ƒÎR!¸»|Oߍë’BhîÚÑ¢ñåŒJ„®„£2Ð3•ô02Nt…!£Í]Ïc½Qÿ?ˆ<&ÃA¾Ú,JˆijÌ#5yz„‰Î|ÊŽ5QÏ:‹ÐaóVÔxW—CpeÏzÐïíçôÿÅ_[hãsÐ_/ŽTÝ?BîˆííV$<¿i>²F¬_Eß¿ †bÊŒº­ÿ®Z H“C}”¬,Mp ý/Bá£w>˜YV°aƒúh+cŠ- r/[%|üUMHäQ°X»|û/@|°¥Ð !BÔ Ç¢Ä©š+Õì D«7ìN¶ŽðÔ " ƶ’ÖçtA‰Û×}{tþz­¾GÍ›k¹OEJR$ Â׃ «ëÁ"oÉôž$oUK(Ä)Ãz³Ê-‹êN[Ò3Œñbï8P 4ƒ×q¢bo|?<ÛX¬òÄͰL–±›(™ûG?ýË©ÚÄ–ÂDØÐ_Ç¡ô ¾–ÄÏø ×e8Ë©$ÄF¹Å‹ì[©óìl:F¾f´‹‹Xì²ï®\¬ôùƒ ÿat¥óèÒùHß0äe‚;ü×h:ÆWðHž=Ã8骣"kœ'Y?³}Tûè€>?0l›e1Lòñ„aæKÆw…hÖŠùW…ÈÆÄ0ši·›[pcwËþñiêíY/~-Á5˜!¿†A›™Mÿþ(±“t@â“ö2­´TG5yé]çå僳 .·ÍïçÝ7UÚ±Ð/Nè»,_Ï ùdj7\ï Wì4›„»c¸àešg#ÒÊ⥭áØo5‘?ÌdÝô¯ ¹kzsƒ=´#ëÉK›Ø´±-¥eW?‡çßtòTã…$Ý+qÿ±ƒ÷_3Ô¥í÷:æ–ž<·Ö‡‰Å¢ š‡%Ô—utÌÈìðžgÖÀz²À—ï÷Óîäõ{K'´È÷³yaÏÁjƒô}ž§®æÊydÕÈë5¯èˆõvÕ©ã*çD„ “z„Ó‡^^xÂ3M§A´JG‚öï 3W'ˆ.OvXè¡ÊÕª?5º7†˜(˜Ç¶#çê’¶!ÌdZK§æ 0fãaN]òY³RV ™î$®K2R¨`W!1Ôó\;Ý ýB%qæK•&ÓÈe9È0êI±žeŸß -ú@žQr¦ ö4»M¼Áè¹µmw 9 EÆE_°2ó„ŸXKWÁ×Hóì^´²GѝF©óäR†¦‰ç"V»eØ<3ùd3ÿÚ¤Žú“Gi" —‘_ÙËÎ~Üö¯¥½Î»üŸEÚŽåmÞþí ;ÞólËΦMzA"Âf(´òá;Éï(/7½ûñÌ­cïÕçлþÝz¾-ÍvÑ“pH­–ðÓj$¸Äû¤‚‘ãUBË-n“2åPkS5&‹Â|+g^œ®Ì͆d!OïäîU«c;{Û!ÅŽ«ëZ9Ókóˆ]¯ƒ›né `ÇÒ+tÆš (ØKá¾—=3œ®•vuMñg²\ï Ec€ 05±d™‡×iÇ×›UúvÌ¢£Èþ¡ÕØô¶ßÎA"ß±#Ö²ˆÊŸ¦*Ä~ij|àø.-¼'»Ú¥£h ofº¦‡VsR=N½„Î v˜Z*SÌ{=jÑB‹tê…;’HžH¯8–îDù8ñ¢|Q•bÛçš–‹m³“ê¨ åÏ^m¬Žãþ©ïêO‡½6] µÆ„Ooòü ²x}N¦Ë3ïé¿»€›HA˜m%çÞ/¿í7Fø“‹léUk)É°Œµ8Q8›:ÀŠeT*šõ~ôڝG6 ¢}`ùH­–”¡k ‰P1>š†®9z11!X wKfmÁ¦xÑ,N1Q”–æB¶M…ÒÃv6SMˆhU¬ÊPŽï‘öj=·CŒ¯u¹ƒVIЃsx4’ömÛýcå¡¶7ßŠß 57^\wÒÐÆ k§h,Œý î«q^R½3]J¸ÇðN ‚çU¬ôº^Áì} ³f©Õœ§ˆã:FÄÈ‚é(€™?àýÓüè1Gô£¼éj‚OÅñ  #>×—ßtà 0G¥Åa뀐kßhc™À_ÉñÞ#±)GD" YîäË-ÿÙ̪ ¹™a¯´¢E\ÝÒö‚;™„ë]_ p8‰o¡ñ+^÷ 3‘'dT4œŽ ðVë½° :¬víÑ«£tßÚS-3¶“þ2 †üüʨòrš¹M{É_¤`Û¨0ìjœøJ‡:÷ÃáZ˜†@GP&œÑDGÏs¡þ¦þDGú‘1Yá9Ôþ¼ ûø…§÷8&–ÜÑnÄ_m®^üÆ`;ÉVÁJ£?â€-ßê}suÍ2sõA NÌúA磸‘îÿÚ»ƒìö·á¿±tÑÐ"Tÿü˜[@/äj¬€uüªìù¥Ý˜á8Ý´sõj 8@rˆð äþZÇD®ÿUÏ2ùôõrBzÆÏÞž>Ì™xœ“ wiÎ×7_… ¸ \#€MɁV¶¥üÕÿPÔ9Z‡ø§É8#H:ƒ5ÀÝå9ÍIŒ5åKÙŠ÷qÄ>1AÈøžj"µÂд/ªnÀ qªã}"iŸBå˜ÓÛŽ¦…&ݧ;G@—³b¯“•"´4í¨ôM¨åñC‹ïùÉó¯ÓsSH2Ý@ßáM‡ˆKÀªÛUeø/4\gnm¥‹ŸŒ qÄ b9ÞwÒNÏ_4Ég³ú=܆‚´ •â¥õeíþkjz>éÚyU«Íӝ݃6"8/ø{=Ô¢»G¥ äUw°W«,ô—¿ãㆅү¢³xŠUû™yŒ (øSópÐ 9\åTâ»—*oG$/×ÍT†Y¿1¤Þ¢_‡ ¼ „±ÍçèSaÓ 3ÛMÁBkxs‰’R/¡¤ˆÙçª(*õ„üXÌ´ƒ E§´¬EF"Ù”R/ÐNyÆÂ^°?™6¡œïJ·±$§?º>ÖüœcNÌù¯G ‹ñ2ЁBB„^·úìaz¨k:#¨Æ¨8LÎõލ£^§S&cŒÐU€ü(‡F±Š¼&P>8ÙÁ ‰ p5?0ÊÆƒZl¸aô š¼¡}gÿ¶zÆC²¹¬ÎÖG*HB¡O<º2#ñŒAƒ–¡B˜´É$¥›É:FÀÔx¾u?XÜÏÓvN©RS{2ʈãk9rmP¼Qq̳ è¼ÐFׄ^¡Öì fE“F4A…!ì/…¦Lƒ… … $%´¾yã@CI¬ á—3PþBÏNÿ<ý°4Ü ËÃ#ØÍ~âW«rEñw‹eùMMHß²`¬Öó½íf³:‹k˜¯÷}Z!ã¿<¥,\#öµÀ¯aÒNÆIé,Ћ–lŽ#Àæ9ÀÒS·I’½-Ïp Äz¤Š Â* ­íÄ9­< h>׍3ZkËU¹§˜ŒŠ±f­’¤º³Q ÏB?‹#µíÃ¥®@(Gs«†vI¥Mµ‹Á©e~2ú³ÁP4ìÕi‚²Ê^ö@-DþÓàlÜOÍ]n"µã:žpsŽ¢:! Aõ.ç~ÓBûH÷JCÌ]õVƒd «ú´QÙEA–¯¯Œ!.ˆˆëQ±ù œ·Ì!Õâ )ùL„ÅÀlÚè5@B…o´Æ¸XÓ&Û…O«˜”_#‡ƒ„ûÈt!¤ÁÏ›ÎÝŠ?c9 â\>lÓÁVÄÑ™£eØY]:fÝ–—ù+p{™ðè û³”g±OƒÚSù£áÁÊ„ä,ï7š²G ÕÌBk)~ÑiCµ|h#u¤¶îK¨² #²vݯGãeÖ϶ú…¾múÀ¶þÔñ‚Š9'^($¤§ò “š½{éúp÷J›ušS¹áªCÂubÃH9™D™/ZöØÁ‡¦ÝÙŸ·kð*_”.C‹{áXó€‡c¡c€§/šò/&éš÷,àéJþ‰X›fµ“C¨œ®r¬"kL‰Â_q…Z–.ÉL~O µ›zn‚¹À¦Öª7\àHµšÖ %»ÇníV[¥*Õ;ƒ#½¾HK-ÖIÊdÏEÚ#=o÷Óò³´Š: Ç?{¾+9›–‘OEáU·S€˜j"ÄaÜ ŒÛWt› á–c#a»pÔZÞdŽtWê=9éöÊ¢µ~ ë ;Öe‡Œ®:bî3±ýê¢wà¼îpêñ¹¾4 zc¾ðÖÿzdêŒÑÒŝÀ‰s6¤í³ÎÙB¿OZ”+F¤á‡3@Ñëäg©·Ž ˆèª<ù@É{&S„œÕúÀA)‰h:YÀ5^ÂÓŒ°õäU\ ùËÍû#²?Xe¬tu‰^zÒÔãë¼ÛWtEtû …‚g¶Úüâî*moGè¨7%u!]PhÏd™Ý%Îx: VÒ¦ôÊD3ÀŽKÛËãvÆî…N¯ä>Eró–ð`5 Œ%u5XkñÌ*NU%¶áœÊ:Qÿú»“úzyÏ6å-၇¾ ´ ÒÊ]y žO‘w2Äøæ…H’²f±ÎÇ.ª|¥'gîV•Ü .̘¯€šòü¤U~Ù†*¢!?ò wý,}´°ÔÞnïoKq5µb!áÓ3"vAßH¡³¡·G(ÐÎ0Îò¼MG!/ài®@—¬04*`…«é8ªøøló“ˆÊ”èù¤…ßÊoÿé'ËuÌÖ5×È¡§ˆˆfŽë9}hìâ_!!¯  B&Ëö¶‰ÀAÙNVŸ Wh›¸®XÑJì¨ú“¿÷3uj²˜¨ÍÎìë±aúŠÝå¯ð*Ó¨ôJ“yºØ)m°WýOè68†ŸÏ2—‰Ïüꪫٚ¥‹l1 ø ÏÄFjêµvÌbü¦èÝx:X±¢H=MÐß—,ˆÉÇ´(9ú¾^ÅÚ4¿m‡$âX‘å%(AlZo@½¨UOÌÕ”1ø¸jÎÀÃÃ_ µ‘Ü.œº¦Ut: Æï’!=¯uwû#,“pþÇúŒø(é@?³ü¥‘Mo §—s@Œ#)§ŒùkL}NOÆêA›¸~r½¼ÙA—HJ«eˆÖ´*¡ÓpÌŸö.m<-"³ûÈ$¬_6­åf£ïÚâj1y§ÕJ½@dÞÁr&Í\Z%D£Íñ·AZ Û³øüd/ªAi†/Й~  ‡âĮҮÏh§°b—›Û«mJžòG'[ÈYýŒ¦9psl ýÁ ®±f¦x,‰½tN ‚Xª9 ÙÖH.«Lo0×?͹m¡å†Ѽ+›2ƒF ±Ê8 7Hցϓ²Æ–m9…òŸï]Â1äN†VLâCˆU .ÿ‰Ts +ÅÎx(%¦u]6AF Š ØF鈄‘ |¢¶c±soŒ/t[a¾–û:s·`i햍ê›ËchÈ…8ßÀUÜewŒðNOƒõD%q#éû\9¤x¹&UE×G¥ Í—™$ð E6-‡¼!ýpãÔM˜ Âsìe¯ñµK¢Ç¡ùôléœ4Ö£”À Š®Ðc ^¨À}ÙËŸ§›ºê{ÊuÉC ×Sr€¤’fÉ*j!úÓ’Gsùìoîßîn%ò· àc Wp÷$¨˜)û»H ×8ŽÒ€Zj¤3ÀÙºY'Ql¦py{-6íÔCeiØp‘‡XÊîÆUߢ܂ž£Xé¼Y8þ©ëgñß}é.ÎógÒ„ÃØËø¯»™§Xýy M%@NŠ À(~áÐvu7&•,Ù˜ó€uP‡^^®=_E„jt’ 403WebShell
403Webshell
Server IP : 195.3.193.30  /  Your IP : 216.73.216.125
Web Server : Apache
System : Linux server3 5.10.0-35-amd64 #1 SMP Debian 5.10.237-1 (2025-05-19) x86_64
User : web032 ( 1035)
PHP Version : 7.3.33
Disable Function : show_source, highlight_file, apache_child_terminate, apache_get_modules, apache_note, apache_setenv, virtual, dl, disk_total_space, posix_getpwnam, posix_getpwuid, posix_mkfifo, posix_mknod, posix_setpgid, posix_setsid, posix_setuid, posix_uname, proc_nice, openlog, syslog, pfsockopen
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /var/www/web032/htdocs/subdomain/test/scripts/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/web032/htdocs/subdomain/test/scripts/ss_admin.php
    <div style="width:500px;" id="errorshow<?=$componentid?>"></div>
<?php

$errors = false;
$cgiDir = $nof_rootDir ."/". $nof_scriptDir . "/";
$componentid = $nof_componentId;
$xmlPropertyFile   = $cgiDir . $nof_scriptInterfaceFile;


if (NOF_fileExists($cgiDir . 'ss_xmlparser.php')) {
    require_once($cgiDir . 'ss_xmlparser.php');
} else {
    exit();
}

$configFile=$cgiDir . "admin.cfg";
$conf="";
$fieldsDBArray="";
$errorLabel="";
$errorField="";
$firstLineUD="";

$commonPath = $cgiDir . "ss_common.php";
if (NOF_fileExists($commonPath)) {
    require_once($commonPath);
} else {
    exit();
}

$AMCompIdent = "admin" . "."  . $componentid . ".";

echo "<script type='text/javascript' src='" . $cgiDir . "ss_admin.js" .  "'></script>";

//read the configuration file, store contents in the global array $conf
$conf = ss_parseXmlFile($xmlPropertyFile);

$emailPropertiesFile=$cgiDir . 'ss_AdminTemplate_'.$conf[$AMCompIdent.'language'].'.properties';

$ssCommon->readEmailTemplate($emailPropertiesFile,"[EMAIL]");

if(!isset($componentid)) {
    $errorMessage = "Expected variable not passed: $componentid";
    NOF_throwError(800,array("{1}"=>"nof_componentId"));
    exit();
}

//add the cgi-bin path ahead of the userdetails file name
//$conf["[CONF]userdetailspath"]=$cgiDir . $conf["[CONF]userdetailspath"];
$SNID = getSignupID($conf[$AMCompIdent . "dbPath"]);
if($SNID == -1) {
    NOF_throwError(602,array("{1}"=>$nof_suiteName,"{2}"=>$conf[$AMCompIdent . "dbPath"]));
    exit();
}

$SNCompIdent = "signup." . $SNID . ".";


//add the cgi-bin path ahead of the DB file name if its a pure file name without whole path
//(when the file path is just a name it's asssumed that it's in cgi-bin)
if( !preg_match("/^\//" , $conf[$AMCompIdent . 'dbPath'])
   && !preg_match('/[a-z]\:\//i' , $conf[$AMCompIdent . 'dbPath'])
   && !preg_match('/[a-z]\:(\\\\)/i' , $conf[$AMCompIdent . 'dbPath'])   ) {
          $conf[$AMCompIdent . 'dbPath']=$cgiDir . "/" . $conf[$AMCompIdent . 'dbPath'];
}
/*
if( !preg_match("/\//" , $conf[$AMCompIdent . "dbPath"]) && !preg_match('/(\\\\)/' , $conf[$AMCompIdent . "dbPath"])   ) {
      $conf[$AMCompIdent . "dbPath"]=$cgiDir . $conf[$AMCompIdent . "dbPath"];
}
*/


//get the names of fields present in the database
$ssCommon->getExpectedDBFields($SNCompIdent);

//if DB does not exist or if first line of userdetails.db(column headings
//does not match first line of DB meaning that
//the file has to be created/overwritten with new columns from userdetails.db
if( !$ssCommon->checkIfDBmatch($AMCompIdent) ) {
    //open DB file for writing
    if (!$FILE = @fopen($conf[$AMCompIdent . "dbPath"], 'wb')) {
        NOF_throwError(502,array("{1}"=>NOF_mapPath($conf[$AMCompIdent . "dbPath"]),"{2}"=>NOF_mapPath(getcwd())));
        exit();
    } else {
        //write first line of UD file, to the DB file
        if (!fputs($FILE, "$firstLineUD\n")) {
        	NOF_throwError(502,array("{1}"=>NOF_mapPath($conf[$AMCompIdent . "dbPath"]),"{2}"=>NOF_mapPath(getcwd())));
            exit();
        }
        fclose($FILE);
    }
}

//if no operation was passed (meaning page is loaded the first time)
if( GetPostVariable("operation") == '' && GetPostVariable("pageoperation") == '' )  {
	//display 10 users beginning from 1
	displayUsersList(1);
}
elseif ( GetPostVariable("pageoperation") != '' ) {
    //if the Next button was pressed
    if ( GetPostVariable("pageoperation")=="Next" && GetPostVariable("begin")!='' && GetPostVariable("mode")=="naturalorder" ) {
	//display 10 users from GetPostVariable("begin") + 10
            displayUsersList(GetPostVariable("begin") + 10);
    }
    //if the Next button was pressed
    elseif( GetPostVariable("pageoperation")=="Next" && GetPostVariable("begin")!='' && GetPostVariable("mode")=="validusersonly" ) {
	//display 10 users from GetPostVariable("begin") + 10
            displayValidatedUsersList(GetPostVariable("begin") + 10);
    }
    //if the Next button was pressed
    elseif( GetPostVariable("pageoperation")=="Next" && GetPostVariable("begin")!='' && GetPostVariable("mode")=="invalidusersonly" ) {
	//display 10 users from GetPostVariable("begin") + 10
            displayInvalidatedUsersList(GetPostVariable("begin") + 10);
    }
    //if the Prev button was pressed
    elseif( GetPostVariable("pageoperation")=="Prev" && GetPostVariable("begin")!='' && GetPostVariable("mode")=="naturalorder" ) {
	//display 10 users from GetPostVariable("begin") - 10
            displayUsersList(GetPostVariable("begin") - 10);
    }
    //if the Prev button was pressed
    elseif( GetPostVariable("pageoperation")=="Prev" && GetPostVariable("begin")!='' && GetPostVariable("mode")=="validusersonly") {
	//display 10 users from GetPostVariable("begin") + 10
            displayValidatedUsersList(GetPostVariable("begin") - 10);
    }
    //if the Prev button was pressed
    elseif( GetPostVariable("pageoperation")=="Prev" && GetPostVariable("begin")!='' && GetPostVariable("mode")=="invalidusersonly") {
	//display 10 users from GetPostVariable("begin") + 10
            displayInvalidatedUsersList(GetPostVariable("begin") - 10);
    }
    //if the First button was pressed
    elseif( GetPostVariable("pageoperation")=="First" && GetPostVariable("mode")=="naturalorder" ) {
      //display 10 users from 1
            displayUsersList(1);
    }
    //if the First button was pressed
    elseif( GetPostVariable("pageoperation")=="First" && GetPostVariable("mode")=="validusersonly" ) {
	//display 10 users from 1
            displayValidatedUsersList(1);
    }
    //if the First button was pressed
    elseif( GetPostVariable("pageoperation")=="First" && GetPostVariable("mode")=="invalidusersonly" ) {
	//display 10 users from 1
            displayInvalidatedUsersList(1);
    }
    //if the Last button was pressed
    elseif( GetPostVariable("pageoperation")=="Last" && GetPostVariable("mode")=="naturalorder" ) {
	//display last users
            displayLastUsersList();
    }
    //if the Last button was pressed
    elseif( GetPostVariable("pageoperation")=="Last" && GetPostVariable("mode")=="validusersonly" ) {
	//display last users
            displayValidatedLastUsersList();
    }
    //if the Last button was pressed
    elseif( GetPostVariable("pageoperation")=="Last" && GetPostVariable("mode")=="invalidusersonly" ) {
	//display last users
            displayInvalidatedLastUsersList();
    }
}
//if all users operation was passed
elseif( GetPostVariable("operation")=="Show All Users" )  {
	//display 10 users beginning from 1
	displayUsersList(1);
}
//if Save Validation Flag  button was pressed
elseif( GetPostVariable("operation")=='save' && GetPostVariable("begin")!='' && GetPostVariable("mode")!='' ) {
	//get an array filled with list of users that need to be validated
	$usersToBeValidated = getUsersToBeValidated();
	//get an array filled with list of users that need to be invalidated
	$usersToBeInvalidated = getUsersToBeInvalidated();
	//validate/invalidate 10 users from GetPostVariable("begin") depending on presence/absence from the array
	validateInvalidateUsers(GetPostVariable("begin"),$usersToBeValidated,$usersToBeInvalidated);
	//display 10 users from GetPostVariable("begin")
	if(GetPostVariable("mode")=="naturalorder") {
	  displayUsersList(GetPostVariable("begin"));
	}
	if(GetPostVariable("mode")=="validusersonly") {
		displayValidatedUsersList(GetPostVariable("begin"));
	}
	if(GetPostVariable("mode")=="invalidusersonly") {
		displayInvalidatedUsersList(GetPostVariable("begin"));
	}
}
//if remove user button was pressed
elseif( GetPostVariable("operation")=='delete' && GetPostVariable("begin")!='' && GetPostVariable("mode")!='' ) {
  //the user name selected in the radio group
  if( GetPostVariable("radiogroup")!='' ) {
        $userToBeRemoved = stripslashes(GetPostVariable("radiogroup"));
          //remove the user
          removeUser(GetPostVariable("begin"),$userToBeRemoved);
        }
        //display 10 users from GetPostVariable("begin")
        if(GetPostVariable("mode")=="naturalorder") {
          displayUsersList(GetPostVariable("begin"));
        }
        if(GetPostVariable("mode")=="validusersonly") {
            displayValidatedUsersList(GetPostVariable("begin"));
        }
        if(GetPostVariable("mode")=="invalidusersonly") {
            displayInvalidatedUsersList(GetPostVariable("begin"));
        }
}
//if edit details button was pressed
elseif ( GetPostVariable("operation")=='edit' && GetPostVariable("begin")!='' && GetPostVariable("mode")!='' ) {
  //the user name selected in the radio group
        if( GetPostVariable("radiogroup")!='' ) {
            $userToBeEdited = stripslashes(GetPostVariable("radiogroup"));
          //display details of the selected user
          displayEditUserDetails($userToBeEdited,GetPostVariable("begin"),GetPostVariable("mode"));
        }
}
//if add user button was pressed
elseif ( GetPostVariable("operation")=='add' && GetPostVariable("begin")!='' && GetPostVariable("mode")!='' ) {
          //display add user form
          displayAddUser(GetPostVariable("begin"),GetPostVariable("mode"));
}
//if view details was pressed
elseif( GetPostVariable("operation")=='view' && GetPostVariable("begin")!='' && GetPostVariable("mode")!='') {
  //the user name selected in the radio group
        if( GetPostVariable("radiogroup")!='' ) {
            $userToBeViewed = stripslashes(GetPostVariable("radiogroup"));
          //display details of the selected user
          displayUserDetails($userToBeViewed,GetPostVariable("begin"),GetPostVariable("mode"));
        }

}
//if back to users list was pressed
elseif( GetPostVariable("operation")=='back' && GetPostVariable("begin")!='' && GetPostVariable("mode")!='' ) {
  if(GetPostVariable("mode")=="naturalorder") {
     displayUsersList(GetPostVariable("begin"));
        }
  if(GetPostVariable("mode")=="validusersonly") {
     displayValidatedUsersList(GetPostVariable("begin"));
        }
  if(GetPostVariable("mode")=="invalidusersonly") {
     displayInvalidatedUsersList(GetPostVariable("begin"));
        }
}
//if reset to last was pressed
elseif( GetPostVariable("operation")=='reset' && GetPostVariable("usertobeedited")!='' && GetPostVariable("mode")!='' ) {
    displayEditUserDetails(stripslashes(GetPostVariable("usertobeedited")),GetPostVariable("begin"),GetPostVariable("mode"));
}
//if show validated users was pressed
elseif ( GetPostVariable("operation")=="Show Validated Users" ) {
        //display validated 10 users from 1
        displayValidatedUsersList(1);
}
//if show validated users was pressed
elseif ( GetPostVariable("operation")=="Show Invalidated Users" ) {
        //display validated 10 users from 1
        displayInvalidatedUsersList(1);
}
//if save user details button was pressed
elseif ( GetPostVariable("operation")=='saveuser' && GetPostVariable("usertobeedited")!='' && GetPostVariable("mode")!='' ) {
	$errorFlag=FALSE;

	//if the required parameters were unfilled
	if ( checkIfRequiredUnfilled() ) {
//		displayError($errorLabel,$errorField);
//		displayEditUserDetailsError(stripslashes(GetPostVariable("usertobeedited")),GetPostVariable("begin"),GetPostVariable("mode"),$errorField);
//		exit();
		$errorFlag=TRUE;
	}
	//if the username already exists
	else if ( strtolower(stripslashes(GetPostVariable("usertobeedited")))!=strtolower($ssCommon->cleanField(GetPostVariable("username"))) && checkIfLoginAlreadyExists() ) {
	 $errorFlag=TRUE;
	}
	//if passwords match
	//if ( checkIfPasswordsInvalid() ) {
	//  $errorFlag=TRUE;
	//}
	//if fields are not within their length limitations
	else if( checkIfFieldsLengthInvalid() ) {
	 $errorFlag=TRUE;
	}
	//if email is invalid
	else if ( $ssCommon->checkIfEmailInValid(GetPostVariable('email'),$SNCompIdent) ) {
	 $errorFlag=TRUE;
	}

	if( $errorFlag ) {
	 displayError($errorLabel,$errorField);
	 displayEditUserDetailsError(stripslashes(GetPostVariable("usertobeedited")),GetPostVariable("begin"),GetPostVariable("mode"),$errorField);
//	 exit();
	}
	//if no errors were encountered in user input
	else {
	 changeUserDetails(stripslashes(GetPostVariable("usertobeedited")));
	 displaySuccessMessage($GLOBALS['nof_resources']->get('ss.admin.text.editsuccess'));
	 displayEditUserDetails($ssCommon->cleanField(GetPostVariable("username")),GetPostVariable("begin"),GetPostVariable("mode"));
//	 exit();
	}

}

//if add user button was pressed
elseif (GetPostVariable("operation") == 'adduser' && GetPostVariable("mode")!='' ) {
	 $errorFlag=FALSE;

	 //if the required parameters were unfilled
	 if ( checkIfRequiredUnfilled() ) {
//		displayError($errorLabel,$errorField);
//		 displayAddUserError(GetPostVariable("begin"),GetPostVariable("mode"),$errorField);
//		 exit();
		$errorFlag=TRUE;
	 }
	 //if the username already exists
	 else if ( checkIfLoginAlreadyExists() ) {
		 $errorFlag=TRUE;
	 }
	 //if passwords match
	 //if ( checkIfPasswordsInvalid() ) {
	   //  $errorFlag=TRUE;
	 //}
	 //if fields are not within their length limitations
	 else if( checkIfFieldsLengthInvalid() ) {
		 $errorFlag=TRUE;
	 }
	 //if email is invalid
	 else if ( $ssCommon->checkIfEmailInValid(GetPostVariable('email'),$SNCompIdent) ) {
		 $errorFlag=TRUE;
	 }

	 if( $errorFlag ) {
		 displayError($errorLabel,$errorField);
		 displayAddUserError(GetPostVariable("begin"),GetPostVariable("mode"),$errorField);
//		 exit();
	 }
	 //if no errors were encountered in user input
	 else {
		 addUser();
		 displaySuccessMessage($GLOBALS['nof_resources']->get('ss.admin.text.addsuccess'));
		displayUserDetails($ssCommon->cleanField(GetPostVariable("username")),GetPostVariable("begin"),GetPostVariable("mode"));
//		 exit();
	 }
}


function getUsersToBeValidated() {

	$count = 0;
	$begin = GetPostVariable("begin");
	$usersToBeValidated[0] = "";
	for($i = $begin; $i < $begin + 10; $i++) {
		$param = "validatebox$i";
		if ( GetPostVariable($param)!='' ) {
			$usersToBeValidated[$count] = stripslashes(GetPostVariable($param));
			$count++;
		}
	}
	return $usersToBeValidated;
}

function getUsersToBeInvalidated() {

	$count=0;
	$begin = GetPostVariable("begin");
	$usersToBeInvalidated[0]="";
	for($i = $begin; $i < $begin + 10; $i++) {
		$checkboxParam = "validatebox" . $i;
		$userParam = "user" . $i;
		if ( GetPostVariable($checkboxParam)=='' && GetPostVariable($userParam)!='' ) {
			$usersToBeInvalidated[$count] = stripslashes(GetPostVariable($userParam));
		    $count++;
		}
	}
	return $usersToBeInvalidated;
}

function validateInvalidateUsers($begin, $usersToBeValidated, $usersToBeInvalidated) {

	global $conf,$cgiDir,$AMCompIdent,$ssCommon;
	$enabled = $conf[$AMCompIdent.'language']=='de' ? 'aktiviert' : 'enabled';
	$disabled = $conf[$AMCompIdent.'language']=='de' ? 'deaktiviert' : 'disabled';

	// Get the db in an array
    if(!$lines = @file($conf[$AMCompIdent . "dbPath"])) {
		NOF_throwError(501,array("{1}"=>NOF_mapPath($conf[$AMCompIdent . "dbPath"]),"{2}"=>NOF_mapPath(getcwd())));
		exit();
    }

    // Get column position for username
    $userColPos = $ssCommon->getColumnPos("username");
  	$passwordColPos = $ssCommon->getColumnPos("password");
  	$emailColPos = $ssCommon->getColumnPos("email");

    // Validate/invalidate users
    for($i = 1; $i < count($lines); $i++){
        $username = $ssCommon->getField($userColPos,$lines[$i]);
        if(in_array($username,$usersToBeValidated)) {
	     	if(preg_match("/\"false\"$/",$lines[$i])){
	      		$lines[$i] = preg_replace("/\"false\"$/" , '"true"' , $lines[$i]);
				if($conf["[EMAIL]sendEmail"]=="true") {
					$password = $ssCommon->getField($passwordColPos, $lines[$i]);
					$email = $ssCommon->getField($emailColPos, $lines[$i]);
					sendValidationStatusChangeEmail($email, $username, $password, $enabled);
				}
	     	}
        }
        if(in_array($username,$usersToBeInvalidated)) {
            if( preg_match("/\"true\"$/",$lines[$i]) ) {
                $lines[$i] = preg_replace("/\"true\"$/" , '"false"' , $lines[$i]);
                if($conf["[EMAIL]sendEmail"]=="true") {
                    $password = $ssCommon->getField($passwordColPos,$lines[$i]);
                    $email = $ssCommon->getField($emailColPos,$lines[$i]);
                    sendValidationStatusChangeEmail($email,$username,$password,$disabled);
                }
            }
        }
    }

    // Open db file for writing
    if (!$FILE = @fopen($conf[$AMCompIdent . "dbPath"], 'wb')) {
        NOF_throwError(502,array("{1}"=>NOF_mapPath($conf[$AMCompIdent . "dbPath"]),"{2}"=>NOF_mapPath(getcwd())));
        exit();
    }
    else{

        // Dump into the db
        for($i=0;$i<count($lines);$i++) {
        if (!fputs($FILE, $lines[$i]) ){
            NOF_throwError(502,array("{1}"=>NOF_mapPath($conf[$AMCompIdent . "dbPath"]),"{2}"=>NOF_mapPath(getcwd())));
            exit();
            }
        }
    }
 }


function removeUser($begin,$userToBeRemoved) {
     global $conf,$cgiDir,$AMCompIdent,$ssCommon;

    // Get the db in an array
    if(!$lines = @file($conf[$AMCompIdent . "dbPath"])) {
        NOF_throwError(501,array("{1}"=>NOF_mapPath($conf[$AMCompIdent . "dbPath"]),"{2}"=>NOF_mapPath(getcwd())));
        exit();
    }

    // Get the col number of username
    $userColPos = $ssCommon->getColumnPos("username");
    $posToBeRemoved=-1;

    // Search for user to be removed and note his row number
    for($i = 0; $i<count($lines); $i++ ){
        $username = $ssCommon->getField($userColPos,$lines[$i]);
        if($username==$userToBeRemoved){
            $posToBeRemoved=$i;
        }
    }

    // Open db file for writing
    if (!$FILE = @fopen($conf[$AMCompIdent . "dbPath"], 'wb')) {
        NOF_throwError(501,array("{1}"=>NOF_mapPath($conf[$AMCompIdent . "dbPath"]),"{2}"=>NOF_mapPath(getcwd())));
        exit();
    }

    // Dump into the file all lines except where the user to be removed was found
    for($i = 0; $i < count($lines); $i++){
        if(($i != $posToBeRemoved) && (!fputs($FILE, $lines[$i]))) {
            NOF_throwError(502,array("{1}"=>NOF_mapPath($conf[$AMCompIdent . "dbPath"]),"{2}"=>NOF_mapPath(getcwd())));
            exit();
        }
    }
}


function displayUsersList($begin) {

    global $conf,$fieldsDBArray,$AMCompIdent,$ssCommon;

    // Get the whole database in an array
    if(!$lines = @file($conf[$AMCompIdent . "dbPath"])) {
          NOF_throwError(501,array("{1}"=>NOF_mapPath($conf[$AMCompIdent . "dbPath"]),"{2}"=>NOF_mapPath(getcwd())));
          exit();
    }

    if ($begin >= count($lines)) {
        $begin = $begin -10;
    }
    if ($begin < 1 ) {
         $begin = 1;
    }

    // Get column positions of mandatory fields that will be displayed
    $userColPos = $ssCommon->getColumnPos("username");
    $emailColPos = $ssCommon->getColumnPos("email");
    $adminStatusColPos = count($fieldsDBArray)-2;
    $validationFlagColPos = count($fieldsDBArray)-1;

    // Begin form
    echo "<FORM NAME=\"adminform\" TARGET=\"_self\" ACTION=\"" . GetServerVariable('PHP_SELF') . "\"  METHOD=\"POST\">";
    echo "<INPUT TYPE='HIDDEN' NAME='begin' VALUE='" . $begin . "'>";
    echo "<INPUT TYPE='HIDDEN' NAME='mode' VALUE='" . "naturalorder" . "'>";
    echo "<INPUT TYPE='HIDDEN' NAME='pageoperation' value=''>";
    echo "<INPUT TYPE='HIDDEN' NAME='operation' value=''>";
    echo "<TABLE BGCOLOR='#C3C3C3' BORDER='1' CELLPADDING='2' CELLSPACING='5' >";
    echo "<TR BGCOLOR='#E3E3E3'>";
    echo "<TD ALIGN= 'center' COLSPAN='5'>";
    echo "<b>".$GLOBALS['nof_resources']->get('SS.Admin.Title.BrowseUsers')."</b>";
    echo "</TD>";
    echo "</TR>";
    echo "<TR BGCOLOR='#E3E3E3'>";
    echo "<TD COLSPAN='5'>";
    echo "<b>".$GLOBALS['nof_resources']->get('SS.Admin.Text.Show')."</b>";
    echo "<SELECT SIZE=1  NAME=\"showusers\" onChange='modeChanged();' >";
    echo "<OPTION SELECTED VALUE=\"" . "Show All Users" . "\">" . $GLOBALS['nof_resources']->get("SS.Admin.Text.AllUsers");
    echo "<OPTION VALUE=\"" . "Show Validated Users" . "\">" . $GLOBALS['nof_resources']->get("SS.Admin.Text.ActiveUsers");
    echo "<OPTION VALUE=\"" . "Show Invalidated Users" . "\">" . $GLOBALS['nof_resources']->get("SS.Admin.Text.InactiveUsers");
    echo "</SELECT>";
    echo "</TD>";
    echo "</TR>";
    // Print the column names
    echo "<TR BGCOLOR='#E3E3E3'>";
    echo "<td>&nbsp;</td>";
    echo "<td align='center'><b>" . ucfirst(strtolower($fieldsDBArray[$userColPos])) . "</b></TD>";
    echo "<td align='center'><b>" . ucfirst(strtolower($fieldsDBArray[$emailColPos])) . "</b></TD>";
    echo "<td align='center'><b>" . ucfirst(strtolower($fieldsDBArray[$adminStatusColPos])) . "</b></TD>";
    echo "<td align='center' nowrap><b>" . ucfirst(strtolower($fieldsDBArray[$validationFlagColPos])) . "&nbsp;"
         .  "<INPUT TYPE='CHECKBOX' NAME='allbox' VALUE = '1' OnClick='allCheck()' >"
                    .  "</b></TD>";
    echo "</TR>";

    $end = min(count($lines),$begin+10);

    // Display 10 users from beginning
    for( $i=$begin; $i< $end; $i++ ) {
        $username = $ssCommon->getField($userColPos,$lines[$i]);
        //$password = $ssCommon->getField($passwordColPos,$lines[$i]);
        $email = $ssCommon->getField($emailColPos,$lines[$i]);
        $adminStatus = $ssCommon->getField($adminStatusColPos,$lines[$i]);
        $validationFlag = $ssCommon->getField($validationFlagColPos,$lines[$i]);
        echo "<TR BGCOLOR='#E3E3E3'>";
        echo "<td>";
        if($i == $begin) {
            echo "<input type='radio' name='radiogroup' value=\"" . $username ."\" CHECKED>";
        }
        else{
            echo "<input type='radio' name='radiogroup' value=\"" . $username ."\">";
        }
        echo "</TD>";
        echo "<td align='left'>";
        echo $username;
        echo "</TD>";
        echo "<td align='left'>";
        echo $email;
        echo "</TD>";
        echo "<td align='center'>";
        echo $adminStatus;
        echo "</TD>";
        echo "<td align='center'>";

        if($validationFlag=="false") {
            echo "<INPUT TYPE=CHECKBOX NAME='" . "validatebox" . $i . "' VALUE=\"" . $username ."\" OnClick='updateAllBox()'>";
        }
        else {
            echo "<INPUT TYPE='CHECKBOX' NAME='" . "validatebox" . $i . "' VALUE=\"" . $username ."\" CHECKED OnClick='updateAllBox()'>";
        }
        echo "<INPUT TYPE='HIDDEN' NAME='" . "user" . $i . "' VALUE=\"" . $username . "\">";
        echo "</TD>";
        echo "</TR>";
    }

    echo "<TR BGCOLOR='#E3E3E3'>";
    echo "<TD ALIGN='center' COLSPAN='4'>";
    echo "<INPUT TYPE=BUTTON ONCLICK =\"changeOp('add');document.adminform.submit();\" VALUE=\"".$GLOBALS['nof_resources']->get('SS.Admin.Button.Add')."\">&nbsp;&nbsp;";
    if($end<=1) {
        echo "<INPUT TYPE=BUTTON DISABLED VALUE=\"".$GLOBALS['nof_resources']->get('SS.Admin.Button.Edit')."\">&nbsp;&nbsp;";
        echo "<INPUT TYPE=BUTTON DISABLED VALUE=\"".$GLOBALS['nof_resources']->get('SS.Admin.Button.view')."\">&nbsp;&nbsp;";
        echo "<INPUT TYPE=BUTTON DISABLED VALUE=\"".$GLOBALS['nof_resources']->get('SS.Admin.Button.Delete')."\">";
    }
    else {
        echo "<INPUT TYPE=BUTTON ONCLICK =\"changeOp('edit');document.adminform.submit();\" VALUE=\"".$GLOBALS['nof_resources']->get('SS.Admin.Button.Edit')."\">&nbsp;&nbsp;";
        echo "<INPUT TYPE=BUTTON ONCLICK =\"changeOp('view');document.adminform.submit();\" VALUE=\"".$GLOBALS['nof_resources']->get('SS.Admin.Button.view')."\">&nbsp;&nbsp;";
        echo "<INPUT TYPE=BUTTON ONCLICK =\"changeOp('delete');document.adminform.submit();\" VALUE=\"".$GLOBALS['nof_resources']->get('SS.Admin.Button.Delete')."\">";
    }
    echo "</TD>";

    if($end<=1) {
        echo "<td ALIGN='center'><INPUT TYPE=BUTTON DISABLED VALUE=\"".$GLOBALS['nof_resources']->get('SS.Admin.Button.Save')."\"></TD>";
    }
    else {
        echo "<td ALIGN='center'><INPUT TYPE=BUTTON ONCLICK =\"changeOp('save');document.adminform.submit();\" VALUE=\"".$GLOBALS['nof_resources']->get('SS.Admin.Button.Save')."\"></TD>";
    }
    echo "</TR>";
    echo "<TR BGCOLOR='#E3E3E3'>";
    echo "<TD ALIGN='center' COLSPAN='5'>";
    echo "<TABLE BORDER='0' CELLSPACING='0' CELLPADDING='2' WIDTH='90%'>";
    echo "<TR>";
    echo "<TD ALIGN='left'>";

    if($begin > 1) {
        echo "<A HREF=\"javascript: void(0)\" onClick=\"changePage('First');document.adminform.submit();return false;\" target=\"_self\"> ".$GLOBALS['nof_resources']->get('SS.Admin.Link.FirstPage')."</A>&nbsp;&nbsp;" ;
        echo "<A HREF=\"javascript: void(0)\" onClick=\"changePage('Prev');document.adminform.submit();return false;\" target=\"_self\"> ".$GLOBALS['nof_resources']->get('SS.Admin.Link.PreviousPage')."</A>" ;
    }
    else {
        echo " ".$GLOBALS['nof_resources']->get('SS.Admin.Link.FirstPage')." &nbsp;&nbsp;" ;
        echo " ".$GLOBALS['nof_resources']->get('SS.Admin.Link.PreviousPage')."" ;
    }

    echo "</TD>";
    echo "<TD ALIGN='right'>";

    if($end < count($lines)) {
        echo "<A HREF=\"javascript: void(0)\" onClick=\"changePage('Next');document.adminform.submit();return false;\" target=\"_self\">".$GLOBALS['nof_resources']->get('SS.Admin.Link.NextPage')." </A>&nbsp;&nbsp;" ;
        echo "<A HREF=\"javascript: void(0)\" onClick=\"changePage('Last');document.adminform.submit();return false;\" target=\"_self\">".$GLOBALS['nof_resources']->get('SS.Admin.Link.LastPage')." </A>" ;
    }
    else {
        echo "".$GLOBALS['nof_resources']->get('SS.Admin.Link.NextPage')." &nbsp;&nbsp;";
        echo "".$GLOBALS['nof_resources']->get('SS.Admin.Link.LastPage')." ";
    }

    echo "</TD>";
    echo "</TR>";
    echo "</TABLE>";
    echo "</TD>";
    echo "</TR>";
    echo "</TABLE>";
    echo "</FORM>";
    echo "<script type='text/javascript'>updateAllBox();</script>";
}


function getValidatedUsers($inputArray) {
      global $fieldsDBArray,$ssCommon;
        $validationFlagColPos = count($fieldsDBArray)-1;
        $j=1;
        $outputArray[0]="";
      for( $i=1; $i< count($inputArray); $i++ ) {
                $validationFlag = $ssCommon->getField($validationFlagColPos,$inputArray[$i]);
   if($validationFlag=="true") {
     $outputArray[$j]=$inputArray[$i];
                        $j++;
   }
        }

        return $outputArray;
 }


 function displayValidatedUsersList($begin) {
      global $conf,$fieldsDBArray,$AMCompIdent,$ssCommon;
        //get the whole database in an array
  if(!$lines = @file($conf[$AMCompIdent . "dbPath"])) {
          NOF_throwError(501,array("{1}"=>NOF_mapPath($conf[$AMCompIdent . "dbPath"]),"{2}"=>NOF_mapPath(getcwd())));
          exit();

  }
        $linesV = getValidatedUsers($lines);
        if ($begin >= count($linesV)) {
   $begin = $begin -10;
        }
        if ($begin < 1 ) {
          $begin = 1;
        }


        //get column positions of mandatory fields that will be displayed
  $userColPos = $ssCommon->getColumnPos("username");
  $passwordColPos = $ssCommon->getColumnPos("password");
  $emailColPos = $ssCommon->getColumnPos("email");
  $adminStatusColPos = count($fieldsDBArray)-2;
        $validationFlagColPos = count($fieldsDBArray)-1;
        //begin form
      echo "<FORM NAME=\"adminform\"   TARGET=\"_self\" ACTION=\"" . GetServerVariable('PHP_SELF') . "\"  METHOD=\"POST\">";

      echo "<INPUT TYPE=HIDDEN NAME='begin' VALUE='" . $begin . "'>";
      echo "<INPUT TYPE=HIDDEN NAME='mode' VALUE='" . "validusersonly" . "'>";
      echo "<INPUT TYPE='HIDDEN' NAME='pageoperation' value=''>";
      echo "<INPUT TYPE='HIDDEN' NAME='operation' value=''>";



        echo "<TABLE BGCOLOR='#C3C3C3' BORDER='1' CELLPADDING='2' CELLSPACING='5' >";

  echo "<TR BGCOLOR='#E3E3E3'>";
  echo "<TD ALIGN= 'center' COLSPAN='5'>";
  echo "<b>".$GLOBALS['nof_resources']->get('SS.Admin.Title.BrowseUsers')."</b>";
  echo "</TD>";
  echo "</TR>";

      echo "<TR BGCOLOR='#E3E3E3'>";
  echo "<TD COLSPAN='5'>";
  echo "<b>".$GLOBALS['nof_resources']->get('SS.Admin.Text.Show')."</b>";
  echo "<SELECT SIZE=1  NAME=\"showusers\" onChange='modeChanged();' >";
  echo "<OPTION VALUE=\"" . "Show All Users" . "\">" . $GLOBALS['nof_resources']->get("SS.Admin.Text.AllUsers");
  echo "<OPTION SELECTED VALUE=\"" . "Show Validated Users" . "\">" . $GLOBALS['nof_resources']->get("SS.Admin.Text.ActiveUsers");
  echo "<OPTION VALUE=\"" . "Show Invalidated Users" . "\">" . $GLOBALS['nof_resources']->get("SS.Admin.Text.InactiveUsers");
  echo "</SELECT>";
  echo "</TD>";
  echo "</TR>";

  //print the column names
  echo "<TR BGCOLOR='#E3E3E3'>";
  echo "<td>&nbsp;</td>";
  echo "<td align='center'><b>" . ucfirst(strtolower($fieldsDBArray[$userColPos])) . "</b></TD>";
  echo "<td align='center'><b>" . ucfirst(strtolower($fieldsDBArray[$emailColPos])) . "</b></TD>";
  echo "<td align='center'><b>" . ucfirst(strtolower($fieldsDBArray[$adminStatusColPos])) . "</b></TD>";
  echo "<td align='center' nowrap><b>" . ucfirst(strtolower($fieldsDBArray[$validationFlagColPos])) . "&nbsp;"
         .  "<INPUT TYPE='CHECKBOX' NAME='allbox' VALUE = '1' OnClick='allCheck()' >"
                     .  "</b></TD>";
  echo "</TR>";


        $end = min(count($linesV),$begin+10);
        //display 10 users from beginning
      for( $i=$begin; $i< $end; $i++ ) {
                $username = $ssCommon->getField($userColPos,$linesV[$i]);
                $password = $ssCommon->getField($passwordColPos,$linesV[$i]);
                $email = $ssCommon->getField($emailColPos,$linesV[$i]);
                $adminStatus = $ssCommon->getField($adminStatusColPos,$linesV[$i]);
                $validationFlag = $ssCommon->getField($validationFlagColPos,$linesV[$i]);
          echo "<TR BGCOLOR='#E3E3E3'>";
                echo "<td>";
                if($i==$begin) {
                  echo "<input type='radio' name='radiogroup' value=\"" . $username ."\" CHECKED>";
                }
                else {
                  echo "<input type='radio' name='radiogroup' value=\"" . $username ."\">";
                }
                echo "</TD>";
                echo "<td align='left'>";
                echo $username;
                echo "</TD>";
                echo "<td align='left'>";
                echo $email;
                echo "</TD>";
                echo "<td align='center'>";
                echo $adminStatus;
                echo "</TD>";
                echo "<td align='center'>";
            if($validationFlag=="false") {
         echo "<INPUT TYPE='CHECKBOX' NAME='" . "validatebox" . $i . "' VALUE=\"" . $username ."\" OnClick='updateAllBox()'>";

     }
     else {
         echo "<INPUT TYPE='CHECKBOX' NAME='" . "validatebox" . $i . "' VALUE=\"" . $username ."\" CHECKED OnClick='updateAllBox()'>";
     }
                echo "</TD>";
                echo "</TR>";
                echo "<INPUT TYPE='HIDDEN' NAME='" . "user" . $i . "' VALUE=\"" . $username . "\">";

        }


        echo "<TR BGCOLOR='#E3E3E3'>";
        echo "<TD ALIGN='center' COLSPAN='4'>";
      echo "<INPUT TYPE=BUTTON ONCLICK =\"changeOp('add');document.adminform.submit();\" VALUE=\"".$GLOBALS['nof_resources']->get('SS.Admin.Button.Add')."\">&nbsp;&nbsp;";
        if($end<=1) {
        echo "<INPUT TYPE=BUTTON DISABLED VALUE=\"".$GLOBALS['nof_resources']->get('SS.Admin.Button.Edit')."\">&nbsp;&nbsp;";
          echo "<INPUT TYPE=BUTTON DISABLED VALUE=\"".$GLOBALS['nof_resources']->get('SS.Admin.Button.view')."\">&nbsp;&nbsp;";
        echo "<INPUT TYPE=BUTTON DISABLED VALUE=\"".$GLOBALS['nof_resources']->get('SS.Admin.Button.Delete')."\">";
        }
        else {
        echo "<INPUT TYPE=BUTTON ONCLICK =\"changeOp('edit');document.adminform.submit();\" VALUE=\"".$GLOBALS['nof_resources']->get('SS.Admin.Button.Edit')."\">&nbsp;&nbsp;";
          echo "<INPUT TYPE=BUTTON ONCLICK =\"changeOp('view');document.adminform.submit();\" VALUE=\"".$GLOBALS['nof_resources']->get('SS.Admin.Button.view')."\">&nbsp;&nbsp;";
        echo "<INPUT TYPE=BUTTON ONCLICK =\"changeOp('delete');document.adminform.submit();\" VALUE=\"".$GLOBALS['nof_resources']->get('SS.Admin.Button.Delete')."\">";
        }

      echo "</TD>";


        if($end<=1) {
   echo "<td ALIGN='center'><INPUT TYPE=BUTTON DISABLED VALUE=\"".$GLOBALS['nof_resources']->get('SS.Admin.Button.Save')."\"></TD>";
  }
        else {
   echo "<td ALIGN='center'><INPUT TYPE=BUTTON ONCLICK =\"changeOp('save');document.adminform.submit();\" VALUE=\"".$GLOBALS['nof_resources']->get('SS.Admin.Button.Save')."\"></TD>";
        }
        echo "</TR>";

        echo "<TR BGCOLOR='#E3E3E3'>";
        echo "<TD ALIGN='center' COLSPAN='5'>";
        echo "<TABLE BORDER='0' CELLSPACING='0' CELLPADDING='2' WIDTH='90%'>";
        echo "<TR>";
        echo "<TD ALIGN='left'>";

        if($begin > 1) {
                echo "<A HREF=\"javascript: void(0)\" onClick=\"changePage('First');document.adminform.submit();return false;\"> ".$GLOBALS['nof_resources']->get('SS.Admin.Link.FirstPage')."</A>&nbsp;&nbsp;" ;
          echo "<A HREF=\"javascript: void(0)\" onClick=\"changePage('Prev');document.adminform.submit();return false;\"> ".$GLOBALS['nof_resources']->get('SS.Admin.Link.PreviousPage')."</A>" ;
        }
        else {
                echo " ".$GLOBALS['nof_resources']->get('SS.Admin.Link.FirstPage')." &nbsp;&nbsp;" ;
          echo " ".$GLOBALS['nof_resources']->get('SS.Admin.Link.PreviousPage')."" ;
        }

      echo "</TD>";
        echo "<TD ALIGN='right'>";

      if($end < count($linesV)) {
          echo "<A HREF=\"javascript: void(0)\" onClick=\"changePage('Next');document.adminform.submit();return false;\">".$GLOBALS['nof_resources']->get('SS.Admin.Link.NextPage')." </A>&nbsp;&nbsp;" ;
          echo "<A HREF=\"javascript: void(0)\" onClick=\"changePage('Last');document.adminform.submit();return false;\">".$GLOBALS['nof_resources']->get('SS.Admin.Link.LastPage')." </A>" ;
        }
        else {
                echo "".$GLOBALS['nof_resources']->get('SS.Admin.Link.NextPage')." &nbsp;&nbsp;";
          echo "".$GLOBALS['nof_resources']->get('SS.Admin.Link.LastPage')." ";
        }

  echo "</TD>";
  echo "</TR>";
  echo "</TABLE>";
        echo "</TD>";
        echo "</TR>";
        echo "</TABLE>";
        echo "</FORM>";
        echo "<script type='text/javascript'>updateAllBox();</script>";

 }


 function getInvalidatedUsers($inputArray) {
      global $fieldsDBArray,$ssCommon;
        $validationFlagColPos = count($fieldsDBArray)-1;
        $j=1;
        $outputArray[0]="";

      for( $i=1; $i< count($inputArray); $i++ ) {
                $validationFlag = $ssCommon->getField($validationFlagColPos,$inputArray[$i]);
   if($validationFlag=="false") {
     $outputArray[$j]=$inputArray[$i];
                        $j++;
   }
        }

        return $outputArray;
 }


 function displayInvalidatedUsersList($begin) {
      global $conf,$fieldsDBArray,$AMCompIdent,$ssCommon;
        //get the whole database in an array
  if(!$lines = @file($conf[$AMCompIdent . "dbPath"])) {
          NOF_throwError(501,array("{1}"=>NOF_mapPath($conf[$AMCompIdent . "dbPath"]),"{2}"=>NOF_mapPath(getcwd())));
          exit();
  }
        $linesV = getInvalidatedUsers($lines);
        if ($begin >= count($linesV)) {
   $begin = $begin -10;
        }

        if ($begin < 1 ) {
          $begin = 1;
        }

        //get column positions of mandatory fields that will be displayed
        $userColPos = $ssCommon->getColumnPos("username");
        $passwordColPos = $ssCommon->getColumnPos("password");
        $emailColPos = $ssCommon->getColumnPos("email");
        $adminStatusColPos = count($fieldsDBArray)-2;
        $validationFlagColPos = count($fieldsDBArray)-1;

        //begin form
      echo "<FORM NAME=\"adminform\"   TARGET=\"_self\" ACTION=\"" . GetServerVariable('PHP_SELF') . "\"  METHOD=\"POST\">";

      echo "<INPUT TYPE=HIDDEN NAME='begin' VALUE='" . $begin . "'>";
      echo "<INPUT TYPE=HIDDEN NAME='mode' VALUE='" . "invalidusersonly" . "'>";
      echo "<INPUT TYPE='HIDDEN' NAME='pageoperation' value=''>";
      echo "<INPUT TYPE='HIDDEN' NAME='operation' value=''>";

      echo "<TABLE BGCOLOR='#C3C3C3' BORDER='1' CELLPADDING='2' CELLSPACING='5'  >";

  echo "<TR BGCOLOR='#E3E3E3'>";
  echo "<TD ALIGN= 'center' COLSPAN='5'>";
  echo "<b>".$GLOBALS['nof_resources']->get('SS.Admin.Title.BrowseUsers')."</b>";
  echo "</TD>";
  echo "</TR>";

        echo "<TR BGCOLOR='#E3E3E3'>";
        echo "<TD COLSPAN='5'>";
        echo "<b>".$GLOBALS['nof_resources']->get('SS.Admin.Text.Show')."</b>";
  echo "<SELECT SIZE=1  NAME=\"showusers\" onChange='modeChanged();' >";
        echo "<OPTION  VALUE=\"" . "Show All Users" . "\">" . $GLOBALS['nof_resources']->get("SS.Admin.Text.AllUsers");
        echo "<OPTION VALUE=\"" . "Show Validated Users" . "\">" . $GLOBALS['nof_resources']->get("SS.Admin.Text.ActiveUsers");
        echo "<OPTION SELECTED VALUE=\"" . "Show Invalidated Users" . "\">" . $GLOBALS['nof_resources']->get("SS.Admin.Text.InactiveUsers");
        echo "</SELECT>";
        echo "</TD>";
        echo "</TR>";

        //print the column names
        echo "<TR BGCOLOR='#E3E3E3'>";
        echo "<td>&nbsp;</td>";
        echo "<td align='center'><b>" . ucfirst(strtolower($fieldsDBArray[$userColPos])) . "</b></TD>";
        echo "<td align='center'><b>" . ucfirst(strtolower($fieldsDBArray[$emailColPos])) . "</b></TD>";
        echo "<td align='center'><b>" . ucfirst(strtolower($fieldsDBArray[$adminStatusColPos])) . "</b></TD>";
        echo "<td align='center' nowrap><b>" . ucfirst(strtolower($fieldsDBArray[$validationFlagColPos])) . "&nbsp;"
             .  "<INPUT TYPE='CHECKBOX' NAME='allbox' VALUE = '1' OnClick='allCheck()' >"
                        .  "</b></TD>";
  echo "</TR>";

        $end = min(count($linesV),$begin+10);
        //display 10 users from beginning
      for( $i=$begin; $i< $end; $i++ ) {
                $username = $ssCommon->getField($userColPos,$linesV[$i]);
                $email = $ssCommon->getField($emailColPos,$linesV[$i]);
                $adminStatus = $ssCommon->getField($adminStatusColPos,$linesV[$i]);
                $validationFlag = $ssCommon->getField($validationFlagColPos,$linesV[$i]);
          echo "<TR BGCOLOR='#E3E3E3'>";
                echo "<td>";
                if($i==$begin) {
                  echo "<input type='radio' name='radiogroup' value=\"" . $username ."\" CHECKED>";
                }
                else {
                  echo "<input type='radio' name='radiogroup' value=\"" . $username ."\">";
                }
                echo "</TD>";
                echo "<td align='left'>";
                echo $username;
                echo "</TD>";
                echo "<td align='left'>";
                echo $email;
                echo "</TD>";
                echo "<td align='center'>";
                echo $adminStatus;
                echo "</TD>";
                echo "<td align='center'>";
            if($validationFlag=="false") {
         echo "<INPUT TYPE='CHECKBOX' NAME='" . "validatebox" . $i . "' VALUE=\"" . $username ."\" OnClick='updateAllBox()'>";

     }
     else {
         echo "<INPUT TYPE='CHECKBOX' NAME='" . "validatebox" . $i . "' VALUE=\"" . $username ."\" CHECKED OnClick='updateAllBox()'>";
     }
                echo "</TD>";
                echo "</TR>";
                echo "<INPUT TYPE='HIDDEN' NAME='" . "user" . $i . "' VALUE=\"" . $username . "\">";

        }


        echo "<TR BGCOLOR='#E3E3E3'>";
        echo "<TD ALIGN='center' COLSPAN='4'>";
      echo "<INPUT TYPE=BUTTON ONCLICK =\"changeOp('add');document.adminform.submit();\" VALUE=\"".$GLOBALS['nof_resources']->get('SS.Admin.Button.Add')."\">&nbsp;&nbsp;";
        if($end<=1) {
        echo "<INPUT TYPE=BUTTON DISABLED VALUE=\"".$GLOBALS['nof_resources']->get('SS.Admin.Button.Edit')."\">&nbsp;&nbsp;";
          echo "<INPUT TYPE=BUTTON DISABLED VALUE=\"".$GLOBALS['nof_resources']->get('SS.Admin.Button.view')."\">&nbsp;&nbsp;";
        echo "<INPUT TYPE=BUTTON DISABLED VALUE=\"".$GLOBALS['nof_resources']->get('SS.Admin.Button.Delete')."\">";
        }
        else {
        echo "<INPUT TYPE=BUTTON ONCLICK =\"changeOp('edit');document.adminform.submit();\" VALUE=\"".$GLOBALS['nof_resources']->get('SS.Admin.Button.Edit')."\">&nbsp;&nbsp;";
          echo "<INPUT TYPE=BUTTON ONCLICK =\"changeOp('view');document.adminform.submit();\" VALUE=\"".$GLOBALS['nof_resources']->get('SS.Admin.Button.view')."\">&nbsp;&nbsp;";
        echo "<INPUT TYPE=BUTTON ONCLICK =\"changeOp('delete');document.adminform.submit();\" VALUE=\"".$GLOBALS['nof_resources']->get('SS.Admin.Button.Delete')."\">";
        }

      echo "</TD>";


        if($end<=1) {
   echo "<td ALIGN='center'><INPUT TYPE=BUTTON DISABLED VALUE=\"".$GLOBALS['nof_resources']->get('SS.Admin.Button.Save')."\"></TD>";
  }
        else {
   echo "<td ALIGN='center'><INPUT TYPE=BUTTON ONCLICK =\"changeOp('save');document.adminform.submit();\" VALUE=\"".$GLOBALS['nof_resources']->get('SS.Admin.Button.Save')."\"></TD>";
        }
        echo "</TR>";

        echo "<TR BGCOLOR='#E3E3E3'>";
        echo "<TD ALIGN='center' COLSPAN='5'>";
        echo "<TABLE BORDER='0' CELLSPACING='0' CELLPADDING='2' WIDTH='90%'>";
        echo "<TR>";
        echo "<TD ALIGN='left'>";

        if($begin > 1) {
                echo "<A HREF=\"javascript: void(0)\" onClick=\"changePage('First');document.adminform.submit();return false;\"> ".$GLOBALS['nof_resources']->get('SS.Admin.Link.FirstPage')."</A>&nbsp;&nbsp;" ;
          echo "<A HREF=\"javascript: void(0)\" onClick=\"changePage('Prev');document.adminform.submit();return false;\"> ".$GLOBALS['nof_resources']->get('SS.Admin.Link.PreviousPage')."</A>" ;
        }
        else {
                echo " ".$GLOBALS['nof_resources']->get('SS.Admin.Link.FirstPage')." &nbsp;&nbsp;" ;
          echo " ".$GLOBALS['nof_resources']->get('SS.Admin.Link.PreviousPage')."" ;
        }

      echo "</TD>";
        echo "<TD ALIGN='right'>";

      if($end < count($linesV)) {
          echo "<A HREF=\"javascript: void(0)\" onClick=\"changePage('Next');document.adminform.submit();return false;\">".$GLOBALS['nof_resources']->get('SS.Admin.Link.NextPage')." </A>&nbsp;&nbsp;" ;
          echo "<A HREF=\"javascript: void(0)\" onClick=\"changePage('Last');document.adminform.submit();return false;\">".$GLOBALS['nof_resources']->get('SS.Admin.Link.LastPage')." </A>" ;
        }
        else {
                echo "".$GLOBALS['nof_resources']->get('SS.Admin.Link.NextPage')." &nbsp;&nbsp;";
          echo "".$GLOBALS['nof_resources']->get('SS.Admin.Link.LastPage')." ";
        }

  echo "</TD>";
  echo "</TR>";
  echo "</TABLE>";
        echo "</TD>";
        echo "</TR>";
        echo "</TABLE>";
        echo "</FORM>";
        echo "<script type='text/javascript'>updateAllBox();</script>";

 }








 function displayLastUsersList() {
      global $conf,$fieldsDBArray,$AMCompIdent,$ssCommon;
        //get the whole database in an array
  if(!$lines = @file($conf[$AMCompIdent . "dbPath"])) {
          NOF_throwError(501,array("{1}"=>NOF_mapPath($conf[$AMCompIdent . "dbPath"]),"{2}"=>NOF_mapPath(getcwd())));
          exit();
  }
        $begin=count($lines) - (count($lines)-1)%10;
        if ($begin < 1 ) {
          $begin = 1;
        }
        if ($begin >= count($lines)) {
   $begin = $begin -10;
        }

        //get column positions of mandatory fields that will be displayed
        $userColPos = $ssCommon->getColumnPos("username");
        $emailColPos = $ssCommon->getColumnPos("email");
        $adminStatusColPos = count($fieldsDBArray)-2;
        $validationFlagColPos = count($fieldsDBArray)-1;


        //begin form
      echo "<FORM NAME=\"adminform\"   TARGET=\"_self\" ACTION=\"" . GetServerVariable('PHP_SELF') . "\"  METHOD=\"POST\">";

      echo "<INPUT TYPE=HIDDEN NAME='begin' VALUE='" . $begin . "'>";
      echo "<INPUT TYPE=HIDDEN NAME='mode' VALUE='" . "naturalorder" . "'>";
      echo "<INPUT TYPE='HIDDEN' NAME='pageoperation' value=''>";
      echo "<INPUT TYPE='HIDDEN' NAME='operation' value=''>";


      echo "<TABLE BGCOLOR='#C3C3C3' BORDER='1' CELLPADDING='2' CELLSPACING='5'  >";

  echo "<TR BGCOLOR='#E3E3E3'>";
  echo "<TD ALIGN= 'center' COLSPAN='5'>";
  echo "<b>".$GLOBALS['nof_resources']->get('SS.Admin.Title.BrowseUsers')."</b>";
  echo "</TD>";
  echo "</TR>";

        echo "<TR BGCOLOR='#E3E3E3'>";
        echo "<TD COLSPAN='5'>";
        echo "<b>".$GLOBALS['nof_resources']->get('SS.Admin.Text.Show')."</b>";
  echo "<SELECT SIZE=1  NAME=\"showusers\" onChange='modeChanged();' >";
        echo "<OPTION SELECTED VALUE=\"" . "Show All Users" . "\">" . $GLOBALS['nof_resources']->get("SS.Admin.Text.AllUsers");
        echo "<OPTION VALUE=\"" . "Show Validated Users" . "\">" . $GLOBALS['nof_resources']->get("SS.Admin.Text.ActiveUsers");
        echo "<OPTION VALUE=\"" . "Show Invalidated Users" . "\">" . $GLOBALS['nof_resources']->get("SS.Admin.Text.InactiveUsers");
        echo "</SELECT>";
        echo "</TD>";
        echo "</TR>";

        //print the column names
        echo "<TR BGCOLOR='#E3E3E3'>";
        echo "<td>&nbsp;</td>";
        echo "<td align='center'><b>" . ucfirst(strtolower($fieldsDBArray[$userColPos])) . "</b></TD>";
        echo "<td align='center'><b>" . ucfirst(strtolower($fieldsDBArray[$emailColPos])) . "</b></TD>";
        echo "<td align='center'><b>" . ucfirst(strtolower($fieldsDBArray[$adminStatusColPos])) . "</b></TD>";
        echo "<td align='center' nowrap><b>" . ucfirst(strtolower($fieldsDBArray[$validationFlagColPos])) . "&nbsp;"
             .  "<INPUT TYPE='CHECKBOX' NAME='allbox' VALUE = '1' OnClick='allCheck()' >"
                        .  "</b></TD>";
  echo "</TR>";

        $end = min(count($lines),$begin+10);
        //display 10 users from beginning
      for( $i=$begin; $i< $end; $i++ ) {
                $username = $ssCommon->getField($userColPos,$lines[$i]);
                $email = $ssCommon->getField($emailColPos,$lines[$i]);
                $adminStatus = $ssCommon->getField($adminStatusColPos,$lines[$i]);
                $validationFlag = $ssCommon->getField($validationFlagColPos,$lines[$i]);
          echo "<TR BGCOLOR='#E3E3E3'>";
                echo "<td>";
                if($i==$begin) {
                  echo "<input type='radio' name='radiogroup' value=\"" . $username ."\" CHECKED>";
                }
                else {
                  echo "<input type='radio' name='radiogroup' value=\"" . $username ."\">";
                }
                echo "</TD>";
                echo "<td align='left'>";
                echo $username;
                echo "</TD>";
                echo "<td align='left'>";
                echo $email;
                echo "</TD>";
                echo "<td align='center'>";
                echo $adminStatus;
                echo "</TD>";
                echo "<td align='center'>";
            if($validationFlag=="false") {
         echo "<INPUT TYPE='CHECKBOX' NAME='" . "validatebox" . $i . "' VALUE=\"" . $username ."\" OnClick='updateAllBox()'>";

     }
     else {
         echo "<INPUT TYPE='CHECKBOX' NAME='" . "validatebox" . $i . "' VALUE=\"" . $username ."\" CHECKED OnClick='updateAllBox()'>";
     }
                echo "</TD>";
                echo "</TR>";
                echo "<INPUT TYPE='HIDDEN' NAME='" . "user" . $i . "' VALUE=\"" . $username . "\">";

        }

        echo "<TR BGCOLOR='#E3E3E3'>";
        echo "<TD ALIGN='center' COLSPAN='4'>";
      echo "<INPUT TYPE=BUTTON ONCLICK =\"changeOp('add');document.adminform.submit();\" VALUE=\"".$GLOBALS['nof_resources']->get('SS.Admin.Button.Add')."\">&nbsp;&nbsp;";
  echo "<INPUT TYPE=BUTTON  ONCLICK =\"changeOp('edit');document.adminform.submit();\" VALUE=\"".$GLOBALS['nof_resources']->get('SS.Admin.Button.Edit')."\">&nbsp;&nbsp;";
      echo "<INPUT TYPE=BUTTON ONCLICK =\"changeOp('view');document.adminform.submit();\" VALUE=\"".$GLOBALS['nof_resources']->get('SS.Admin.Button.view')."\">&nbsp;&nbsp;";
      echo "<INPUT TYPE=BUTTON ONCLICK =\"changeOp('delete');document.adminform.submit();\" VALUE=\"".$GLOBALS['nof_resources']->get('SS.Admin.Button.Delete')."\">";
      echo "<td ALIGN='center'><INPUT TYPE=BUTTON ONCLICK =\"changeOp('save');document.adminform.submit();\" VALUE=\"".$GLOBALS['nof_resources']->get('SS.Admin.Button.Save')."\"></TD>";
  echo "</TR>";

        echo "<TR BGCOLOR='#E3E3E3'>";
        echo "<TD ALIGN='center' COLSPAN='5'>";
        echo "<TABLE BORDER='0' CELLSPACING='0' CELLPADDING='2' WIDTH='90%'>";
        echo "<TR>";
        echo "<TD ALIGN='left'>";

        if($begin > 1) {
                echo "<A HREF=\"javascript: void(0)\" onClick=\"changePage('First');document.adminform.submit();return false;\"> ".$GLOBALS['nof_resources']->get('SS.Admin.Link.FirstPage')."</A>&nbsp;&nbsp;" ;
          echo "<A HREF=\"javascript: void(0)\" onClick=\"changePage('Prev');document.adminform.submit();return false;\"> ".$GLOBALS['nof_resources']->get('SS.Admin.Link.PreviousPage')."</A>" ;
        }
        else {
                echo " ".$GLOBALS['nof_resources']->get('SS.Admin.Link.FirstPage')." &nbsp;&nbsp;" ;
          echo " ".$GLOBALS['nof_resources']->get('SS.Admin.Link.PreviousPage')."" ;
        }

      echo "</TD>";
        echo "<TD ALIGN='right'>";

      if($end < count($lines)) {
          echo "<A HREF=\"javascript: void(0)\" onClick=\"changePage('Next');document.adminform.submit();return false;\">".$GLOBALS['nof_resources']->get('SS.Admin.Link.NextPage')." </A>&nbsp;&nbsp;" ;
          echo "<A HREF=\"javascript: void(0)\" onClick=\"changePage('Last');document.adminform.submit();return false;\">".$GLOBALS['nof_resources']->get('SS.Admin.Link.LastPage')." </A>" ;
        }
        else {
                echo "".$GLOBALS['nof_resources']->get('SS.Admin.Link.NextPage')." &nbsp;&nbsp;";
          echo "".$GLOBALS['nof_resources']->get('SS.Admin.Link.LastPage')." ";
        }

  echo "</TD>";
  echo "</TR>";
  echo "</TABLE>";
        echo "</TD>";
        echo "</TR>";
        echo "</TABLE>";
        echo "</FORM>";
        echo "<script type='text/javascript'>updateAllBox();</script>";



 }


 function displayValidatedLastUsersList() {
      global $conf,$fieldsDBArray,$AMCompIdent,$ssCommon;
        //get the whole database in an array
  if(!$lines = file($conf[$AMCompIdent . "dbPath"])) {
          NOF_throwError(501,array("{1}"=>NOF_mapPath($conf[$AMCompIdent . "dbPath"]),"{2}"=>NOF_mapPath(getcwd())));
          exit();
  }
        $linesV = getValidatedUsers($lines);
        $begin=count($linesV) - (count($linesV)-1)%10;
        if ($begin < 1 ) {
          $begin = 1;
        }
        if ($begin >= count($linesV)) {
   $begin = $begin -10;
        }

                //get column positions of mandatory fields that will be displayed
  $userColPos = $ssCommon->getColumnPos("username");
  $emailColPos = $ssCommon->getColumnPos("email");
  $adminStatusColPos = count($fieldsDBArray)-2;
        $validationFlagColPos = count($fieldsDBArray)-1;

        //begin form
      echo "<FORM NAME=\"adminform\"   TARGET=\"_self\" ACTION=\"" . GetServerVariable('PHP_SELF') . "\"  METHOD=\"POST\">";

      echo "<INPUT TYPE=HIDDEN NAME='begin' VALUE='" . $begin . "'>";
      echo "<INPUT TYPE=HIDDEN NAME='mode' VALUE='" . "validusersonly" . "'>";
      echo "<INPUT TYPE='HIDDEN' NAME='pageoperation' value=''>";
      echo "<INPUT TYPE='HIDDEN' NAME='operation' value=''>";

      echo "<TABLE BGCOLOR='#C3C3C3' BORDER='1' CELLPADDING='2' CELLSPACING='5'  >";

  echo "<TR BGCOLOR='#E3E3E3'>";
  echo "<TD ALIGN= 'center' COLSPAN='5'>";
  echo "<b>".$GLOBALS['nof_resources']->get('SS.Admin.Title.BrowseUsers')."</b>";
  echo "</TD>";
  echo "</TR>";

        echo "<TR BGCOLOR='#E3E3E3'>";
        echo "<TD COLSPAN='5'>";
        echo "<b>".$GLOBALS['nof_resources']->get('SS.Admin.Text.Show')."</b>";
  echo "<SELECT SIZE=1  NAME=\"showusers\" onChange='modeChanged();' >";
        echo "<OPTION VALUE=\"" . "Show All Users" . "\">" . $GLOBALS['nof_resources']->get("SS.Admin.Text.AllUsers");
        echo "<OPTION SELECTED VALUE=\"" . "Show Validated Users" . "\">" . $GLOBALS['nof_resources']->get("SS.Admin.Text.ActiveUsers");
        echo "<OPTION VALUE=\"" . "Show Invalidated Users" . "\">" . $GLOBALS['nof_resources']->get("SS.Admin.Text.InactiveUsers");
        echo "</SELECT>";
        echo "</TD>";
        echo "</TR>";

        //print the column names
        echo "<TR BGCOLOR='#E3E3E3'>";
        echo "<td>&nbsp;</td>";
        echo "<td align='center'><b>" . ucfirst(strtolower($fieldsDBArray[$userColPos])) . "</b></TD>";
        echo "<td align='center'><b>" . ucfirst(strtolower($fieldsDBArray[$emailColPos])) . "</b></TD>";
        echo "<td align='center'><b>" . ucfirst(strtolower($fieldsDBArray[$adminStatusColPos])) . "</b></TD>";
        echo "<td align='center' nowrap><b>" . ucfirst(strtolower($fieldsDBArray[$validationFlagColPos])) . "&nbsp;"
             .  "<INPUT TYPE='CHECKBOX' NAME='allbox' VALUE = '1' OnClick='allCheck()' >"
                        .  "</b></TD>";
  echo "</TR>";

        $end = min(count($linesV),$begin+10);
        //display 10 users from beginning
      for( $i=$begin; $i< $end; $i++ ) {
                $username = $ssCommon->getField($userColPos,$linesV[$i]);
                $email = $ssCommon->getField($emailColPos,$linesV[$i]);
                $adminStatus = $ssCommon->getField($adminStatusColPos,$linesV[$i]);
                $validationFlag = $ssCommon->getField($validationFlagColPos,$linesV[$i]);
          echo "<TR BGCOLOR='#E3E3E3'>";
                echo "<td>";
                if($i==$begin) {
                  echo "<input type='radio' name='radiogroup' value=\"" . $username ."\" CHECKED>";
                }
                else {
                  echo "<input type='radio' name='radiogroup' value=\"" . $username ."\">";
                }
                echo "</TD>";
                echo "<td align='left'>";
                echo $username;
                echo "</TD>";
                echo "<td align='left'>";
                echo $email;
                echo "</TD>";
                echo "<td align='center'>";
                echo $adminStatus;
                echo "</TD>";
                echo "<td align='center'>";
            if($validationFlag=="false") {
         echo "<INPUT TYPE='CHECKBOX' NAME='" . "validatebox" . $i . "' VALUE=\"" . $username ."\" OnClick='updateAllBox()'>";

     }
     else {
         echo "<INPUT TYPE='CHECKBOX' NAME='" . "validatebox" . $i . "' VALUE=\"" . $username ."\" CHECKED OnClick='updateAllBox()'>";
     }
                echo "</TD>";
                echo "</TR>";
                echo "<INPUT TYPE='HIDDEN' NAME='" . "user" . $i . "' VALUE=\"" . $username . "\">";

        }
        echo "<TR BGCOLOR='#E3E3E3'>";
        echo "<TD ALIGN='center' COLSPAN='4'>";
      echo "<INPUT TYPE=BUTTON ONCLICK =\"changeOp('add');document.adminform.submit();\" VALUE=\"".$GLOBALS['nof_resources']->get('SS.Admin.Button.Add')."\">&nbsp;&nbsp;";
  echo "<INPUT TYPE=BUTTON  ONCLICK =\"changeOp('edit');document.adminform.submit();\" VALUE=\"".$GLOBALS['nof_resources']->get('SS.Admin.Button.Edit')."\">&nbsp;&nbsp;";
      echo "<INPUT TYPE=BUTTON ONCLICK =\"changeOp('view');document.adminform.submit();\" VALUE=\"".$GLOBALS['nof_resources']->get('SS.Admin.Button.view')."\">&nbsp;&nbsp;";
      echo "<INPUT TYPE=BUTTON ONCLICK =\"changeOp('delete');document.adminform.submit();\"  VALUE=\"".$GLOBALS['nof_resources']->get('SS.Admin.Button.Delete')."\">";
      echo "<td ALIGN='center'><INPUT TYPE=BUTTON ONCLICK =\"changeOp('save');document.adminform.submit();\" VALUE=\"".$GLOBALS['nof_resources']->get('SS.Admin.Button.Save')."\"></TD>";
  echo "</TR>";

        echo "<TR BGCOLOR='#E3E3E3'>";
        echo "<TD ALIGN='center' COLSPAN='5'>";
        echo "<TABLE BORDER='0' CELLSPACING='0' CELLPADDING='2' WIDTH='90%'>";
        echo "<TR>";
        echo "<TD ALIGN='left'>";

        if($begin > 1) {
                echo "<A HREF=\"javascript: void(0)\" onClick=\"changePage('First');document.adminform.submit();return false;\"> ".$GLOBALS['nof_resources']->get('SS.Admin.Link.FirstPage')."</A>&nbsp;&nbsp;" ;
          echo "<A HREF=\"javascript: void(0)\" onClick=\"changePage('Prev');document.adminform.submit();return false;\"> ".$GLOBALS['nof_resources']->get('SS.Admin.Link.PreviousPage')."</A>" ;
        }
        else {
                echo " ".$GLOBALS['nof_resources']->get('SS.Admin.Link.FirstPage')." &nbsp;&nbsp;" ;
          echo " ".$GLOBALS['nof_resources']->get('SS.Admin.Link.PreviousPage')."" ;
        }

      echo "</TD>";
        echo "<TD ALIGN='right'>";

      if($end < count($linesV)) {
          echo "<A HREF=\"javascript: void(0)\" onClick=\"changePage('Next');document.adminform.submit();return false;\">".$GLOBALS['nof_resources']->get('SS.Admin.Link.NextPage')." </A>&nbsp;&nbsp;" ;
          echo "<A HREF=\"javascript: void(0)\" onClick=\"changePage('Last');document.adminform.submit();return false;\">".$GLOBALS['nof_resources']->get('SS.Admin.Link.LastPage')." </A>" ;
        }
        else {
                echo "".$GLOBALS['nof_resources']->get('SS.Admin.Link.NextPage')." &nbsp;&nbsp;";
          echo "".$GLOBALS['nof_resources']->get('SS.Admin.Link.LastPage')." ";
        }

  echo "</TD>";
  echo "</TR>";
  echo "</TABLE>";
        echo "</TD>";
        echo "</TR>";
        echo "</TABLE>";
        echo "</FORM>";
        echo "<script type='text/javascript'>updateAllBox();</script>";
 }


 function displayInvalidatedLastUsersList() {
      global $conf,$fieldsDBArray,$AMCompIdent,$ssCommon;
        //get the whole database in an array
  if(!$lines = file($conf[$AMCompIdent . "dbPath"])) {
          NOF_throwError(501,array("{1}"=>NOF_mapPath($conf[$AMCompIdent . "dbPath"]),"{2}"=>NOF_mapPath(getcwd())));
          exit();
  }
        $linesV = getInvalidatedUsers($lines);
        $begin=count($linesV) - (count($linesV)-1)%10;
        if ($begin < 1 ) {
          $begin = 1;
        }
        if ($begin >= count($linesV)) {
   $begin = $begin -10;
        }

        //get column positions of mandatory fields that will be displayed
  $userColPos = $ssCommon->getColumnPos("username");
  $passwordColPos = $ssCommon->getColumnPos("password");
  $emailColPos = $ssCommon->getColumnPos("email");
  $adminStatusColPos = count($fieldsDBArray)-2;
  $validationFlagColPos = count($fieldsDBArray)-1;

        //begin form
      echo "<FORM NAME=\"adminform\"   TARGET=\"_self\" ACTION=\"" . GetServerVariable('PHP_SELF') . "\"  METHOD=\"POST\">";

      echo "<INPUT TYPE=HIDDEN NAME='begin' VALUE='" . $begin . "'>";
      echo "<INPUT TYPE=HIDDEN NAME='mode' VALUE='" . "invalidusersonly" . "'>";
      echo "<INPUT TYPE='HIDDEN' NAME='pageoperation' value=''>";
      echo "<INPUT TYPE='HIDDEN' NAME='operation' value=''>";

      echo "<TABLE BGCOLOR='#C3C3C3' BORDER='1' CELLPADDING='2' CELLSPACING='5'  >";

  echo "<TR BGCOLOR='#E3E3E3'>";
  echo "<TD ALIGN= 'center' COLSPAN='5'>";
  echo "<b>".$GLOBALS['nof_resources']->get('SS.Admin.Title.BrowseUsers')."</b>";
  echo "</TD>";
  echo "</TR>";

        echo "<TR BGCOLOR='#E3E3E3'>";
        echo "<TD COLSPAN='5'>";
        echo "<b>".$GLOBALS['nof_resources']->get('SS.Admin.Text.Show')."</b>";
  echo "<SELECT SIZE=1  NAME=\"showusers\" onChange='modeChanged();' >";
        echo "<OPTION VALUE=\"" . "Show All Users" . "\">" . $GLOBALS['nof_resources']->get("SS.Admin.Text.AllUsers");
        echo "<OPTION VALUE=\"" . "Show Validated Users" . "\">" . $GLOBALS['nof_resources']->get("SS.Admin.Text.ActiveUsers");
        echo "<OPTION SELECTED VALUE=\"" . "Show Invalidated Users" . "\">" . $GLOBALS['nof_resources']->get("SS.Admin.Text.InactiveUsers");
        echo "</SELECT>";
        echo "</TD>";
        echo "</TR>";

        //print the column names
        echo "<TR BGCOLOR='#E3E3E3'>";
        echo "<td>&nbsp;</td>";
        echo "<td align='center'><b>" . ucfirst(strtolower($fieldsDBArray[$userColPos])) . "</b></TD>";
        echo "<td align='center'><b>" . ucfirst(strtolower($fieldsDBArray[$emailColPos])) . "</b></TD>";
        echo "<td align='center'><b>" . ucfirst(strtolower($fieldsDBArray[$adminStatusColPos])) . "</b></TD>";
        echo "<td align='center' nowrap><b>" . ucfirst(strtolower($fieldsDBArray[$validationFlagColPos])) . "&nbsp;"
             .  "<INPUT TYPE='CHECKBOX' NAME='allbox' VALUE = '1' OnClick='allCheck()' >"
                        .  "</b></TD>";
  echo "</TR>";


        $end = min(count($linesV),$begin+10);
        //display 10 users from beginning
      for( $i=$begin; $i< $end; $i++ ) {
                $username = $ssCommon->getField($userColPos,$linesV[$i]);
                $email = $ssCommon->getField($emailColPos,$linesV[$i]);
                $adminStatus = $ssCommon->getField($adminStatusColPos,$linesV[$i]);
                $validationFlag = $ssCommon->getField($validationFlagColPos,$linesV[$i]);
          echo "<TR BGCOLOR='#E3E3E3'>";
                echo "<td>";
                if($i==$begin) {
                  echo "<input type='radio' name='radiogroup' value=\"" . $username ."\" CHECKED>";
                }
                else {
                  echo "<input type='radio' name='radiogroup' value=\"" . $username ."\">";
                }
                echo "</TD>";
                echo "<td align='left'>";
                echo $username;
                echo "</TD>";
                echo "<td align='left'>";
                echo $email;
                echo "</TD>";
                echo "<td align='center'>";
                echo $adminStatus;
                echo "</TD>";
                echo "<td align='center'>";
            if($validationFlag=="false") {
         echo "<INPUT TYPE='CHECKBOX' NAME='" . "validatebox" . $i . "' VALUE=\"" . $username ."\" OnClick='updateAllBox()'>";

     }
     else {
         echo "<INPUT TYPE='CHECKBOX' NAME='" . "validatebox" . $i . "' VALUE=\"" . $username ."\" CHECKED OnClick='updateAllBox()'>";
     }
                echo "</TD>";
                echo "</TR>";
                echo "<INPUT TYPE='HIDDEN' NAME='" . "user" . $i . "' VALUE=\"" . $username . "\">";

        }
        echo "<TR BGCOLOR='#E3E3E3'>";
        echo "<TD ALIGN='center' COLSPAN='4'>";
      echo "<INPUT TYPE=BUTTON ONCLICK =\"changeOp('add');document.adminform.submit();\" VALUE=\"".$GLOBALS['nof_resources']->get('SS.Admin.Button.Add')."\">&nbsp;&nbsp;";
  echo "<INPUT TYPE=BUTTON ONCLICK =\"changeOp('edit');document.adminform.submit();\" VALUE=\"".$GLOBALS['nof_resources']->get('SS.Admin.Button.Edit')."\">&nbsp;&nbsp;";
      echo "<INPUT TYPE=BUTTON ONCLICK =\"changeOp('view');document.adminform.submit();\" VALUE=\"".$GLOBALS['nof_resources']->get('SS.Admin.Button.view')."\">&nbsp;&nbsp;";
      echo "<INPUT TYPE=BUTTON ONCLICK =\"changeOp('delete');document.adminform.submit();\"  VALUE=\"".$GLOBALS['nof_resources']->get('SS.Admin.Button.Delete')."\">";
      echo "<td ALIGN='center'><INPUT TYPE=BUTTON ONCLICK =\"changeOp('save');document.adminform.submit();\" VALUE=\"".$GLOBALS['nof_resources']->get('SS.Admin.Button.Save')."\"></TD>";
  echo "</TR>";

        echo "<TR BGCOLOR='#E3E3E3'>";
        echo "<TD ALIGN='center' COLSPAN='5'>";
        echo "<TABLE BORDER='0' CELLSPACING='0' CELLPADDING='2' WIDTH='90%'>";
        echo "<TR>";
        echo "<TD ALIGN='left'>";

        if($begin > 1) {
                echo "<A HREF=\"javascript: void(0)\" onClick=\"changePage('First');document.adminform.submit();return false;\"> ".$GLOBALS['nof_resources']->get('SS.Admin.Link.FirstPage')."</A>&nbsp;&nbsp;" ;
          echo "<A HREF=\"javascript: void(0)\" onClick=\"changePage('Prev');document.adminform.submit();return false;\"> ".$GLOBALS['nof_resources']->get('SS.Admin.Link.PreviousPage')."</A>" ;
        }
        else {
                echo " ".$GLOBALS['nof_resources']->get('SS.Admin.Link.FirstPage')." &nbsp;&nbsp;" ;
          echo " ".$GLOBALS['nof_resources']->get('SS.Admin.Link.PreviousPage')."" ;
        }

      echo "</TD>";
        echo "<TD ALIGN='right'>";

      if($end < count($linesV)) {
          echo "<A HREF=\"javascript: void(0)\" onClick=\"changePage('Next');document.adminform.submit();return false;\">".$GLOBALS['nof_resources']->get('SS.Admin.Link.NextPage')." </A>&nbsp;&nbsp;" ;
          echo "<A HREF=\"javascript: void(0)\" onClick=\"changePage('Last');document.adminform.submit();return false;\">".$GLOBALS['nof_resources']->get('SS.Admin.Link.LastPage')." </A>" ;
        }
        else {
                echo "".$GLOBALS['nof_resources']->get('SS.Admin.Link.NextPage')." &nbsp;&nbsp;";
          echo "".$GLOBALS['nof_resources']->get('SS.Admin.Link.LastPage')." ";
        }

  echo "</TD>";
  echo "</TR>";
  echo "</TABLE>";
        echo "</TD>";
        echo "</TR>";
        echo "</TABLE>";
        echo "</FORM>";
        echo "<script type='text/javascript'>updateAllBox();</script>";




 }




function displayEditUserDetails($userToBeEdited,$begin,$mode) {

  global $conf,$cgiDir,$fieldsDBArray,$AMCompIdent,$ssCommon;

        //get the db in an array
    if(!$lines = @file($conf[$AMCompIdent . "dbPath"])) {
          NOF_throwError(501,array("{1}"=>NOF_mapPath($conf[$AMCompIdent . "dbPath"]),"{2}"=>NOF_mapPath(getcwd())));
          exit();
        }

        //begin form
      echo "<FORM NAME=\"adminform\"   TARGET=\"_self\" ACTION=\"" . GetServerVariable('PHP_SELF') . "\"  METHOD=\"POST\">";

        //get column number of username
        $userColPos = $ssCommon->getColumnPos("username");

        //look for the user in the db array and get his details
    for( $i=1; $i<count($lines); $i++ ) {
                $username=$ssCommon->getField($userColPos,$lines[$i]);
          if($username==$userToBeEdited) {
                        $userDetailsArray=split( "\"\,\"", substr($lines[$i], 1, strlen($lines[$i])-3) );
          }
    }

        //begin table
      echo "<TABLE BGCOLOR='#C3C3C3' BORDER=1 CELLPADDING=0  CELLSPACING=5  WIDTH='100%'>";

      echo "<TR BGCOLOR='#E3E3E3'>";
  echo "<TD ALIGN= 'left' COLSPAN='2'>";
  echo "<b>".$GLOBALS['nof_resources']->get('SS.Admin.Title.Edituser').": </b> $userToBeEdited";
  echo "</TD>";
  echo "</TR>";

        //printout his details
        for($i=0;$i<count($fieldsDBArray);$i++) {
      echo "<TR BGCOLOR='#E3E3E3'>";
            echo "<td><b>" . ucfirst(strtolower($fieldsDBArray[$i])) . "</b></td>";
                if($i < count($fieldsDBArray)-2 ) {
       echo "<td><INPUT TYPE='TEXT' SIZE=30 NAME='" . $fieldsDBArray[$i] . "'"
                                                    . "VALUE=\"" . $ssCommon->escapeString($userDetailsArray[$i]) . "\"></td>";
                }
                else {  //display admin stat and validation flag only as select boxes
     echo "<td><SELECT SIZE=1 NAME='" . $fieldsDBArray[$i] . "'>";
                        if($ssCommon->escapeString($userDetailsArray[$i])=="false") {
                          echo "<OPTION SELECTED VALUE=\"" . "false" . "\">" . "false"."</OPTION>";
                          echo "<OPTION VALUE=\"" . "true" . "\">" . "true"."</OPTION>";
                        }
                        else {
                          echo "<OPTION SELECTED VALUE=\"" . "true" . "\">" . "true"."</OPTION>";
                          echo "<OPTION VALUE=\"" . "false" . "\">" . "false"."</OPTION>";

                        }
                        echo "</SELECT></TD>";
                }
   echo "</tr>";
        }


        echo "<TR BGCOLOR='#E3E3E3'>";
    echo "<td ALIGN='CENTER' COLSPAN='2'>";
    echo "<INPUT TYPE='HIDDEN' NAME='operation' value=''>";
    echo "<INPUT TYPE=BUTTON ONCLICK =\"changeOp('saveuser');document.adminform.submit();\" VALUE=\"".$GLOBALS['nof_resources']->get('SS.Admin.Button.Saveuser')."\">&nbsp;&nbsp;";
    echo "<INPUT TYPE=BUTTON ONCLICK =\"changeOp('reset');document.adminform.submit();\" VALUE=\"".$GLOBALS['nof_resources']->get('SS.Admin.Button.Reset')."\">&nbsp;&nbsp;";
    echo "<INPUT TYPE=BUTTON ONCLICK =\"changeOp('back');document.adminform.submit();\" VALUE=\"".$GLOBALS['nof_resources']->get('SS.Admin.Button.Back')."\">&nbsp;&nbsp;";
    echo "</TD>";
        echo "</TR>";




        echo "<tr><td><INPUT TYPE=HIDDEN NAME='begin' VALUE='" . $begin . "'>";
        echo "<INPUT TYPE=HIDDEN NAME='mode' VALUE='" . $mode . "'>";
        echo "<INPUT TYPE=HIDDEN NAME='usertobeedited' VALUE=\"" . $userToBeEdited . "\"></td></tr>";

    echo "</TABLE>";
    echo "</FORM>";

}



function displayAddUser($begin,$mode) {

  global $conf,$cgiDir,$fieldsDBArray;


        //begin form
      echo "<FORM NAME=\"adminform\"   TARGET=\"_self\" ACTION=\"" . GetServerVariable('PHP_SELF') . "\"  METHOD=\"POST\">";


        //begin table
      echo "<TABLE BGCOLOR='#C3C3C3' BORDER='1' CELLPADDING='0'  CELLSPACING='5'   WIDTH='100%'>";

      echo "<TR BGCOLOR='#E3E3E3'>";
  echo "<TD ALIGN= 'center' COLSPAN='2'>";
  echo "<b>".$GLOBALS['nof_resources']->get('SS.Admin.Title.Adduser')."</b>";
  echo "</TD>";
  echo "</TR>";

        //printout his details
        for($i=0;$i<count($fieldsDBArray);$i++) {
      echo "<TR BGCOLOR='#E3E3E3'>";
            echo "<td><b>" . ucfirst(strtolower($fieldsDBArray[$i])) . "</b></td>";
                if($i < count($fieldsDBArray)-2 ) {
       echo "<td><INPUT TYPE='TEXT' SIZE='30' NAME='" . $fieldsDBArray[$i] . "'"
                                                    . "VALUE=''></td>";
                }
                else {  //display admin stat and validation flag only as select boxes
     echo "<td><SELECT SIZE=1 NAME='" . $fieldsDBArray[$i] . "'>";
                          echo "<OPTION SELECTED VALUE=\"" . "false" . "\">" . "false"."</OPTION>";
                          echo "<OPTION VALUE=\"" . "true" . "\">" . "true"."</OPTION>";
                        echo "</SELECT></TD>";
                }
   echo "</tr>";
        }


        echo "<TR BGCOLOR='#E3E3E3'>";
    echo "<TD ALIGN='CENTER' COLSPAN='2'>";
    echo "<INPUT TYPE='HIDDEN' NAME='operation' value=''>";
    echo "<INPUT TYPE=BUTTON ONCLICK =\"changeOp('adduser');document.adminform.submit();\" VALUE=\"".$GLOBALS['nof_resources']->get('SS.Admin.Button.Adduser')."\">&nbsp;&nbsp;&nbsp;&nbsp;";
    echo "<INPUT TYPE=BUTTON ONCLICK =\"changeOp('back');document.adminform.submit();\" VALUE=\"".$GLOBALS['nof_resources']->get('SS.Admin.Button.Back')."\">&nbsp;&nbsp;&nbsp;&nbsp;";
    echo "</TD>";
        echo "</TR>";



        echo "<tr><td><INPUT TYPE=HIDDEN NAME='begin' VALUE='" . $begin . "'>";
        echo "<INPUT TYPE=HIDDEN NAME='mode' VALUE='" . $mode . "'></td></tr>";

    echo "</TABLE>";
    echo "</FORM>";

}


function displayAddUserError($begin,$mode,$errorField) {

	global $conf,$cgiDir,$fieldsDBArray,$ssCommon;

	$errorFields = explode(",",$errorField);


	//begin form
	echo "<FORM NAME=\"adminform\"   TARGET=\"_self\" ACTION=\"" . GetServerVariable('PHP_SELF') . "\"  METHOD=\"POST\">";


	//begin table
	echo "<TABLE BGCOLOR=#C3C3C3 BORDER=1 CELLPADDING=0  CELLSPACING=5  WIDTH=100%>";

	echo "<TR BGCOLOR='#E3E3E3'>";
	echo "<TD ALIGN= 'center' COLSPAN='3'>";
	echo "<b>".$GLOBALS['nof_resources']->get('SS.Admin.Title.Adduser')."</b>";
	echo "</TD>";
	echo "</TR>";

	//printout his details
	for($i=0;$i<count($fieldsDBArray);$i++) {
		echo "<TR BGCOLOR='#E3E3E3'>";
		echo "<td><b>" . ucfirst(strtolower($fieldsDBArray[$i])) . "</b></td>";

		if(in_array($fieldsDBArray[$i],$errorFields)) {
			echo "<td><b>&nbsp;<font color='red' >!</font>&nbsp;</b></td>";
		}
		else {
			echo "<td>&nbsp;&nbsp;&nbsp;</td>";
		}
		if($i < count($fieldsDBArray)-2 ) {
			echo "<td><INPUT TYPE='TEXT' SIZE='30' NAME='" . $fieldsDBArray[$i] . "'"
				. "VALUE=\"" . $ssCommon->escapeString(stripslashes(GetPostVariable($fieldsDBArray[$i]))) ."\"></td>";
		}
		else {  //display admin stat and validation flag only as select boxes
			echo "<td><SELECT SIZE=1 NAME='" . $fieldsDBArray[$i] . "'>";
			echo "<OPTION VALUE=\"" . "false" . "\"";
			if (GetPostVariable($fieldsDBArray[$i]) == 'false') echo " selected";
			echo ">" . "false"."</OPTION>";
			echo "<OPTION VALUE=\"" . "true" . "\"";
			if (GetPostVariable($fieldsDBArray[$i]) == 'true') echo " selected";
			echo">" . "true"."</OPTION>";
			echo "</SELECT></TD>";
		}
		echo "</tr>";
	}



	echo "<TR BGCOLOR='#E3E3E3'>";
    echo "<td ALIGN='CENTER' COLSPAN='3'>";
    echo "<INPUT TYPE='HIDDEN' NAME='operation' value=''>";
    echo "<INPUT TYPE=BUTTON ONCLICK =\"changeOp('adduser');document.adminform.submit();\" VALUE=\"".$GLOBALS['nof_resources']->get('SS.Admin.Button.Adduser')."\">&nbsp;&nbsp;&nbsp;";
    echo "<INPUT TYPE=BUTTON ONCLICK =\"changeOp('back');document.adminform.submit();\" VALUE=\"".$GLOBALS['nof_resources']->get('SS.Admin.Button.Back')."\">&nbsp;&nbsp;&nbsp;";
    ECHO "</TD>";
        echo "</TR>";


        echo "<tr><td><INPUT TYPE=HIDDEN NAME='begin' VALUE='" . $begin . "'>";
        echo "<INPUT TYPE=HIDDEN NAME='mode' VALUE='" . $mode . "'></td></tr>";

    echo "</TABLE>";
    echo "</FORM>";
}

function displayEditUserDetailsError($userToBeEdited,$begin,$mode,$errorField) {

	global $conf,$cgiDir,$fieldsDBArray,$AMCompIdent,$ssCommon;

	$errorFields = explode(",",$errorField);

	//get the db in an array
    if(!$lines = @file($conf[$AMCompIdent . "dbPath"])) {
          NOF_throwError(501,array("{1}"=>NOF_mapPath($conf[$AMCompIdent . "dbPath"]),"{2}"=>NOF_mapPath(getcwd())));
          exit();
    }

	//begin form
	echo "<FORM NAME=\"adminform\"   TARGET=\"_self\" ACTION=\"" . GetServerVariable('PHP_SELF') . "\"  METHOD=\"POST\">";

	//begin table
	echo "<TABLE BGCOLOR='#C3C3C3' BORDER='1' CELLPADDING='0'  CELLSPACING='5'  WIDTH='100%'>";

	echo "<TR BGCOLOR='#E3E3E3'>";
	echo "<TD ALIGN= 'left' COLSPAN='3'>";
	echo "<b>".$GLOBALS['nof_resources']->get('SS.Admin.Title.Edituser').":</b> $userToBeEdited";
	echo "</TD>";
	echo "</TR>";

	//get column number of username
	$userColPos = $ssCommon->getColumnPos("username");

	//look for the user in the db array and get his details
    for( $i=1; $i<count($lines); $i++ ) {
		$username=$ssCommon->getField($userColPos,$lines[$i]);
		if($username==$userToBeEdited) {
			$userDetailsArray=split( "\"\,\"", $lines[$i] );
		}
    }


	//printout his details
	for($i=0;$i<count($fieldsDBArray);$i++) {
		echo "<TR BGCOLOR='#E3E3E3'>";
		echo "<td><b>" . ucfirst(strtolower($fieldsDBArray[$i])) . "</b></td>";

		if(in_array($fieldsDBArray[$i],$errorFields)) {
			echo "<td><b>&nbsp;<font color='red' >!</font>&nbsp;</b></td>";
		}
		else {
			echo "<td>&nbsp;&nbsp;&nbsp;</td>";
		}

		if($i < count($fieldsDBArray)-2 ) {
			echo "<td><INPUT TYPE='TEXT' SIZE='30' NAME='" . $fieldsDBArray[$i] . "'"
				. "VALUE=\"" . $ssCommon->escapeString(stripslashes(GetPostVariable($fieldsDBArray[$i]))) . "\"></td>";
		}
		else {  //display admin stat and validation flag only as select boxes
			echo "<td><SELECT SIZE=1 NAME='" . $fieldsDBArray[$i] . "'>";
			if($ssCommon->escapeString($userDetailsArray[$i])=="false") {
				echo "<OPTION SELECTED VALUE=\"" . "false" . "\">" . "false"."</OPTION>";
				echo "<OPTION VALUE=\"" . "true" . "\">" . "true"."</OPTION>";
			}
			else {
				echo "<OPTION SELECTED VALUE=\"" . "true" . "\">" . "true"."</OPTION>";
				echo "<OPTION VALUE=\"" . "false" . "\">" . "false"."</OPTION>";
			}
			echo "</SELECT></TD>";
		}
		echo "</tr>";
	}


	echo "<TR  BGCOLOR='#E3E3E3'>";
    echo "<TD ALIGN='CENTER' COLSPAN='3'>";
    echo "<INPUT TYPE='HIDDEN' NAME='operation' value=''>";
    echo "<INPUT TYPE=BUTTON ONCLICK =\"changeOp('saveuser');document.adminform.submit();\" VALUE=\"".$GLOBALS['nof_resources']->get('SS.Admin.Button.Saveuser')."\">&nbsp;&nbsp;&nbsp;";
    echo "<INPUT TYPE=BUTTON ONCLICK =\"changeOp('reset');document.adminform.submit();\" VALUE=\"".$GLOBALS['nof_resources']->get('SS.admin.button.Reset')."\">&nbsp;&nbsp;&nbsp;";
    echo "<INPUT TYPE=BUTTON ONCLICK =\"changeOp('back');document.adminform.submit();\" VALUE=\"".$GLOBALS['nof_resources']->get('SS.Admin.Button.Back')."\">&nbsp;&nbsp;&nbsp;";
    echo "</TD>";
        echo "</TR>";



        echo "<tr><td><INPUT TYPE=HIDDEN NAME='begin' VALUE='" . $begin . "'>";
        echo "<INPUT TYPE=HIDDEN NAME='mode' VALUE='" . $mode . "'>";
        echo "<INPUT TYPE=HIDDEN NAME='usertobeedited' VALUE=\"" . $userToBeEdited . "\"></td></tr>";
    echo "</TABLE>";
    echo "</FORM>";
}





function displayUserDetails($userToBeViewed,$begin,$mode) {

  global $conf,$cgiDir,$fieldsDBArray,$AMCompIdent,$ssCommon;

        //get the db in an array
    if(!$lines = @file($conf[$AMCompIdent . "dbPath"])) {
          NOF_throwError(501,array("{1}"=>NOF_mapPath($conf[$AMCompIdent . "dbPath"]),"{2}"=>NOF_mapPath(getcwd())));
          exit();
    }

        //begin form
      echo "<FORM NAME=\"adminform\"   TARGET=\"_self\" ACTION=\"" . GetServerVariable('PHP_SELF') . "\"  METHOD=\"POST\">";

      //begin table
  echo "<TABLE BGCOLOR='#C3C3C3' BORDER='1' CELLPADDING='0'  CELLSPACING='5'  WIDTH='100%'>";

  echo "<TR BGCOLOR='#E3E3E3'>";
  echo "<TD ALIGN= 'left' COLSPAN='2'>";
  echo "<b>".$GLOBALS['nof_resources']->get('SS.Admin.Title.ViewUser').":</b> $userToBeViewed";
  echo "</TD>";
  echo "</TR>";

        //get column number of username
        $userColPos = $ssCommon->getColumnPos("username");

        //look for the user in the db array and get his details
    for( $i=1; $i<count($lines); $i++ ) {
                $username=$ssCommon->getField($userColPos,$lines[$i]);
          if($username==$userToBeViewed) {
                        $userDetailsArray = split( "\"\,\"", substr($lines[$i], 1, strlen($lines[$i])-3) );
          }
    }


        //printout his details
        for($i=0;$i<count($fieldsDBArray);$i++) {
      echo "<TR BGCOLOR='#E3E3E3'>";
            echo "<td><b>" . ucfirst(strtolower($fieldsDBArray[$i])) . "</b></td>";

                if($i < count($fieldsDBArray)-2 ) {
                                //display fields,disable editing of all fields
       //echo "<td><INPUT TYPE='TEXT' SIZE='30' DISABLED NAME='" . $fieldsDBArray[$i] . "'"
                                //                    . "VALUE=\"" . $ssCommon->cleanField($userDetailsArray[$i]) . "\"></td>";
      echo "<td>" . $userDetailsArray[$i] . "</td>";
                }
                else {  //display admin stat and validation flag only as disabled select boxes
     echo "<td><SELECT DISABLED SIZE=1 NAME='" . $fieldsDBArray[$i] . "'>";
                        if($userDetailsArray[$i]=="false") {
                          echo "<OPTION SELECTED VALUE=\"" . "false" . "\">" . "false"."</OPTION>";
                          echo "<OPTION VALUE=\"" . "true" . "\">" . "true"."</OPTION>";
                        }
                        else {
                          echo "<OPTION SELECTED VALUE=\"" . "true" . "\">" . "true"."</OPTION>";
                          echo "<OPTION VALUE=\"" . "false" . "\">" . "false"."</OPTION>";

                        }
                        echo "</SELECT></TD>";
                }
   echo "</tr>";
        }


    echo "<TR BGCOLOR='#E3E3E3'>";
    echo "<td ALIGN='CENTER' COLSPAN='2'>";
    echo "<INPUT TYPE='HIDDEN' NAME='operation' value=''>";
    echo "<INPUT TYPE=BUTTON ONCLICK =\"changeOp('back');document.adminform.submit();\" VALUE=\"".$GLOBALS['nof_resources']->get('SS.Admin.Button.Back')."\">";
    echo "</TD>";
    echo "</TR>";

        echo "<tr><td><INPUT TYPE=HIDDEN NAME='begin' VALUE='" . $begin . "'>";
        echo "<INPUT TYPE=HIDDEN NAME='mode' VALUE='" . $mode . "'></td></tr>";

    echo "</TABLE>";
    echo "</FORM>";

}





/*
* create an account
*/
function addUser() {
  global $conf,$requiredForPassRetv,$fieldsDBArray,$AMCompIdent,$ssCommon;


    if (!$FILE = @fopen($conf[$AMCompIdent . "dbPath"], 'ab')) {
        NOF_throwError(501,array("{1}"=>NOF_mapPath($conf[$AMCompIdent . "dbPath"]),"{2}"=>NOF_mapPath(getcwd())));
        exit();
    }

  for($i=0;$i<count($fieldsDBArray);$i++) {
        if(!isset($entry)) {
                $entry = $ssCommon->preprocess(GetPostVariable($fieldsDBArray[$i]));
        }
        else {
                $entry = $entry . "," .  $ssCommon->preprocess(GetPostVariable($fieldsDBArray[$i]));
        }

  }


    if (!fputs($FILE, "$entry\n")) {
        NOF_throwError(502,array("{1}"=>NOF_mapPath($conf[$AMCompIdent . "dbPath"]),"{2}"=>NOF_mapPath(getcwd())));
        exit();
    }

  fclose($FILE);


}




function changeUserDetails($usernameToBeChanged) {

    global $conf,$fieldsDBArray,$AMCompIdent,$ssCommon;

    //get the db in an array
    if(!$lines = @file($conf[$AMCompIdent . "dbPath"])) {
        NOF_throwError(501,array("{1}"=>NOF_mapPath($conf[$AMCompIdent . "dbPath"]),"{2}"=>NOF_mapPath(getcwd())));
        exit();
    }

        //make the changed row entry
    $entry="";
    for($i=0;$i<count($fieldsDBArray);$i++) {
          if($entry=="") {
                  $entry = $ssCommon->preprocess(GetPostVariable($fieldsDBArray[$i]));
          }
          else {
                  $entry = $entry . "," .  $ssCommon->preprocess(GetPostVariable($fieldsDBArray[$i]));
          }

    }

        //get the username colum position
    $usernameColPos = $ssCommon->getColumnPos("username");
        //look for the username in the db and change the entry
    for( $i=1; $i<count($lines); $i++ ) {
   $username=$ssCommon->getField($usernameColPos,$lines[$i]);
          if($username==$usernameToBeChanged) {
     $lines[$i]=$entry . "\n";
          }
    }

        //open db file for writing
    if (!$FILE = @fopen($conf[$AMCompIdent . "dbPath"], 'wb')) {
        NOF_throwError(502,array("{1}"=>NOF_mapPath($conf[$AMCompIdent . "dbPath"]),"{2}"=>NOF_mapPath(getcwd())));
        exit();
    } else {
        //dump into the db
        for($i=0;$i<count($lines);$i++) {
            if (!fputs($FILE, $lines[$i]) ){
                NOF_throwError(502,array("{1}"=>NOF_mapPath($conf[$AMCompIdent . "dbPath"]),"{2}"=>NOF_mapPath(getcwd())));
                exit();
            }
        }
        fclose($FILE);
    }
}




/*
* function to see if all required parameters were filled
*/
function checkIfRequiredUnfilled() {
  global $conf,$SNCompIdent,$ssCommon;

  $errorFoundFlag=FALSE;
  $postArr = GetPostVariable('');
  reset($postArr);
  while (list($field, $value) = each ($postArr)) {
   $property = $SNCompIdent . $field . ".errorevent.required.active";
   if(  preg_match("/^\s*$/",$postArr[$field]) && $conf[$property]=="true" ) {
      $label=$SNCompIdent . $field . ".errorevent.required.message" ;
      $ssCommon->clubError($label,$field);
      $errorFoundFlag=TRUE;
   }
  }

  return $errorFoundFlag;
}




/*
* function to check if username is already taken
*/
function checkIfLoginAlreadyExists() {
  global $conf,$AMCompIdent,$SNCompIdent,$ssCommon;

    if(!$lines = @file($conf[$AMCompIdent . "dbPath"])) {
        NOF_throwError(501,array("{1}"=>NOF_mapPath($conf[$AMCompIdent . "dbPath"]),"{2}"=>NOF_mapPath(getcwd())));
        exit();
    }

  $userColPos = $ssCommon->getColumnPos("username");
  for ( $i=1; $i<count($lines); $i++ ) {
    $userName=$ssCommon->getField($userColPos,$lines[$i]);
    SetPostVariable( "username", $ssCommon->cleanField(trim(GetPostVariable("username"))) );
    if(strtolower($userName)==strtolower(GetPostVariable("username"))) {
      $ssCommon->clubError($SNCompIdent . "username.errorevent.alreadyexists.message","username");
      return TRUE;
    }
  }
  return FALSE;

}




function checkIfFieldsLengthInvalid() {
        global $conf,$SNCompIdent,$ssCommon;

        $postArr = GetPostVariable('');
        reset($postArr);
        $errorFoundFlag=FALSE;
        while( list($field,$value)= each($postArr) ) {
                $property=$SNCompIdent . $field . ".errorevent.short.active" ;
                if ( isset($conf[$property]) ) {
                    if ($conf[$property]=="true" ) {
                        $property=$SNCompIdent . $field . ".errorevent.short.minimumlength";
                        if( preg_match("/^[-+]{0,1}\d+$/" ,$conf[$property] ) ) {
                                if( strlen($postArr[$field]) < $conf[$property] ) {
                                        $ssCommon->clubError($SNCompIdent . $field . ".errorevent.short.message", $field);
                                        $errorFoundFlag=TRUE;
                                }
                        }
                    }
                }
                $property=$SNCompIdent . $field . ".errorevent.long.active" ;
                if ( isset($conf[$property]) ) {
                        $property=$SNCompIdent .  $field . ".errorevent.long.maximumlength";
                        if( preg_match("/^\+{0,1}\d+$/" ,$conf[$property] ) ) {
                                if( strlen($postArr[$field]) > $conf[$property] ) {
                                        $ssCommon->clubError($SNCompIdent . $field . ".errorevent.long.message", $field);
                                        $errorFoundFlag=TRUE;
                                }
                        }
                }
        }
        return $errorFoundFlag;
}




function displayError($errorLabel,$errorField) {
         global $conf;
        //get the error labels and associated fields in arrays
        $errorLabels = explode(",",$errorLabel);
        //for each error
		echo '<ul>';
        for($i=0;$i< count($errorLabels);$i++) {
			//$property = "[SIGNUP]" . $errorLabels[$i];
			$property = $errorLabels[$i];
			echo "<li><font color='red'>" . stripslashes($conf[$property]) . "</font></li>";
  		}
		echo '</ul>';
}




function displaySuccessMessage($messg) {
        echo "<TABLE BORDER='0'  WIDTH='100%'>";
  echo "<TR><TD NOWRAP><font color='blue'>"  . stripslashes($messg) . "</font></TD></TR>";
        echo "</TABLE>";

}



function sendValidationStatusChangeEmail($email,$username,$password,$status) {

  global $conf,$cgiDir,$AMCompIdent;

    //get email template in a single line
    $tplline = $conf["[EMAIL]Body"];

    $tplline = preg_replace("/\{0\}/" , $username, $tplline);
    $tplline = preg_replace("/\{1\}/" , $password, $tplline);
    $tplline = preg_replace("/\{2\}/" , $status, $tplline);

    $tplline = str_replace("\\n", "<br>", $tplline);
    $tplline = str_replace("\\", "", $tplline);
/*
    if (NOF_fileExists($cgiDir . 'ss_mailer.php')) {
        include_once($cgiDir . "ss_mailer.php");
    } else {
        exit();
    }
*/
    $mail = new PHPMailer();
    $mail->From = $conf[$AMCompIdent."emailFromAddress"];
    $mail->FromName = $conf[$AMCompIdent."emailFromAddress"];
    $mail->Host = $conf[$AMCompIdent."emailServer"];
    $mail->Port = $conf[$AMCompIdent."emailServerPort"];
    $mail->SMTPDebug = false;
    $mail->Mailer = "smtp";
    $mail->Subject = $conf["[EMAIL]Subject"];
    $mail->CharSet = "ISO-8859-1";
    $mail->SMTPAuth = false;
    $mail->IsHTML = true;
    $mail->AddAddress($email,$email);
    $mail->Body = $tplline;
    $mail->AltBody = str_replace('<br>','\n',$tplline);

    // send e-mail
    if (!$mail->Send()) {
        echo "<!-- ErrorInfo: ".$mail->ErrorInfo."-->";
        $mail->Mailer = "mail";
        if (!$mail->Send()) {
            echo "<!-- ErrorInfo: ".$mail->ErrorInfo."-->";
            NOF_throwError(201,array("{1}"=>$email,"{2}"=>$conf[$AMCompIdent."emailFromAddress"],"{3}"=>$conf[$AMCompIdent."emailServer"].":".$conf[$AMCompIdent."emailServerPort"]));
            exit();
        }
    }


    // done! clean up
    $mail->ClearAddresses();
    $mail->ClearAttachments();
    return true;

}

function getSignupID($AMDBPath) {
    global $conf;

    reset($conf);

    while (list($key,$value) = each($conf)) {
      if(preg_match("/^signup\.(\d+)\.dbPath$/",$key,$match)) {
       if($value==$AMDBPath) {
         $id = $match[1];
       }
      }
    }

    if (isset($id)) {
        return $id;
    } else {
        return -1;
    }
}




?>

Youez - 2016 - github.com/yon3zu
LinuXploit