connect($dbname); if ( $DB->connect_on < 1 ) { echo "Can't go on, DB not initialized."; exit; } $MemberOK = false; $MemberDISABLED = false; if(!isset($MemberNick)){$MemberNick="";} if(!isset($MemberPass)){$MemberPass="";} if((isset($FormLogin))&&(isset($FormPassword))){ $FormLogin = prepare_data($FormLogin); $FormPassword = prepare_data($FormPassword); // $FormPassword = crypt($FormPassword, "OL"); $RES = $DB->get_members("where nickname='$FormLogin' and `password`='$FormPassword'"); if(sizeof($RES) == 1){ $curmember = $RES[0]; if($curmember[endis] == "enabled"){ $MemberNick = $FormLogin; $MemberPass = $FormPassword; $MemberOK = true; }else{ $MemberDISABLED = true; $curmember = ""; } } }else{ if(($MemberNick != "")&&($MemberPass != "")){ $RES = $DB->get_members("where nickname='$MemberNick' and `password`='$MemberPass'"); if(sizeof($RES) == 1){ $curmember = $RES[0]; if($curmember[endis] == "enabled"){ $MemberOK = true; }else{ $MemberDISABLED = true; $curmember = ""; } } } } if((!$MemberOK)&&($cmd != "forgotpass")&&($cmd != "signup")){ $cmd=""; } //--- save setting in session variables ---------------------- $_SESSION['MemberNick'] = $MemberNick; $_SESSION['MemberPass'] = $MemberPass; $tpl = new FastTemplate("./"); $tpl->define( array( "index" => "./templates/front_index.tpl", "copyright" => "./templates/indexcopyright.tpl" )); $tpl->define_dynamic( "menuitem" , "index" ); include "./incs/front/index.mod.php"; if(($suffix == "login")||($suffix == "forgotpass")||($suffix == "signup")){ $tpl->clear_dynamic("menuitem"); }else{ $menu_commands = split(",",$front_menu_commands["$curmodule"]); $menu_itemnames = split(",",$front_menu_itemnames["$curmodule"]); for ($j = 1; $j < sizeof($menu_commands); $j++) { $curmenucommand = $menu_commands[$j]; $curmenuitemname = $menu_itemnames[$j]; $extra = ""; $href_commands = "$SCRIPTURL/index.php?cmd=$curmenucommand"; if ($curmenucommand=="chat"){ $extra="onclick=window.open('./chat/chatting.php','','width=630,height=420,scrollbars=0,toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=0');"; $href_commands = "#"; } $tpl->assign( array( "EXTRA_JS" => $extra, "HREF_COMMANDS" => $href_commands, "MENU_ITEM" => $curmenuitemname )); $tpl->parse('SUBMENU',".menuitem"); } } $tpl->assign("SCRIPTURL", $SCRIPTURL); $tpl->assign("SITENAME", $SITENAME); $tpl->assign("INDEX_TITLE", "Welcome to $SITENAME Member Control Panel"); $tpl->assign("INDEX_HEAD", ""); $tpl->assign("INDEX_SUBTITLE", "Member Control Panel"); $cur_date = date("d M, Y"); $tpl->assign("INDEX_DATE", "Today: $cur_date"); $tpl->parse("INDEX_COPYRIGHT", "copyright"); $tpl->parse("MAIN","index"); $tpl->FastPrint(); ?>