"._LOCKMEM.""; if($confirm == "yes") { if(check_prefs($_GET['lock'])) dbquery("UPDATE ".TABLEPREFIX."fanfiction_authorprefs SET level = '-1' WHERE uid = '".$_GET['lock']."'"); else dbquery("INSERT INTO ".TABLEPREFIX."fanfiction_authorprefs(`uid`, `level`) VALUES('".$_GET['lock']."', '-1')"); $output .= write_message(_ACTIONSUCCESSFUL); } else if ($confirm == "no") { $output .= write_message(_ACTIONCANCELLED); } else { $output .= write_message(_LOCKCONFIRM."

[ "._YES." | "._NO." ]"); } } else if(isset($_GET["unlock"]) && isNumber($_GET["unlock"])) { $output .= "
"._UNLOCK."
"; if($confirm == "yes") { dbquery("UPDATE ".TABLEPREFIX."fanfiction_authorprefs SET level = '0' WHERE uid = '".$_GET['unlock']."'"); $output .= write_message(_ACTIONSUCCESSFUL); } else if ($confirm == "no") { $output .= write_message(_ACTIONCANCELLED); } else { $output .= write_message(_CONFIRMUNLOCK."

[ "._YES." | "._NO." ]"); } } else if(isset($_GET["release"]) && isNumber($_GET['release'])) { $output .= "
"._RELEASED."
"; if(_AUTHORTABLE != TABLEPREFIX."fanfiction_authors as author") $output .= write_message("
"._FOREIGNAUTHORTABLE); if($confirm == "yes") { include("includes/emailer.php"); dbquery("UPDATE "._AUTHORTABLE." SET admincreated = '0' WHERE "._UIDFIELD." = '".$_GET['release']."'"); $emailquery = dbquery("SELECT "._EMAILFIELD." as email, "._PENNAMEFIELD." as penname FROM "._AUTHORTABLE." WHERE uid = '".$_GET['release']."'"); $email = dbassoc($emailquery); mt_srand((double)microtime() * 1000000); $charset = '23456789' . 'abcdefghijkmnpqrstuvwxyz' . 'ABCDEFGHJKLMNPQRSTUVWXYZ'; $pass = random_string($charset, 10); $encryppass = md5($pass); //$headers = "From: $sitename\n"; dbquery("UPDATE "._AUTHORTABLE." SET "._PASSWORDFIELD." = '$encryppass' WHERE uid = '".$_GET['release']."'"); $subject = _SIGNUPSUBJECT; $letter = sprintf(_RELEASEMESSAGE, $email['penname'], $pass); $mailresult = sendemail($email['penname'], $email['email'], $sitename, $siteemail, $subject, $letter); if($mailresult) $output .= write_message(_AUTHORRELEASED); else $output .= write_error(_EMAILFAILED); } else if ($confirm == "no") { $output .= write_message(_ACTIONCANCELLED); } else { $output .= write_message(_CONFIRMAUTHORRELEASE."

[ "._YES." | "._NO." ]"); } } else if(isset($_GET["revoke"]) && isNumber($_GET["revoke"])) { $output .= "
"._REVOKEVAL."
"; if($confirm == "yes") { dbquery("UPDATE ".TABLEPREFIX."fanfiction_authorprefs SET validated = '0' WHERE uid = '$_GET[revoke]'"); $output .= write_message(_ACTIONSUCCESSFUL); } else if ($confirm == "no") { $output .= write_message(_ACTIONCANCELLED); } else { $output .= write_message(_CONFIRMVALREVOKE."

[ "._YES." | "._NO." ]"); } } else if(isset($_GET["delete"]) && isNumber($_GET["delete"])) { $output .= "
"._DELETEUSER."
"; if(_AUTHORTABLE != TABLEPREFIX."fanfiction_authors as author") $output .= write_message("
"._FOREIGNAUTHORTABLE); else if($confirm == "yes") { include("includes/deletefunctions.php"); $output .= deleteUser($_GET['delete']); } else if ($confirm == "no") { $output .= write_message(_ACTIONCANCELLED); } else { $output .= write_message(_CONFIRMDELETE."

[ "._YES." | "._NO." ]"); } } else if(isset($_GET["validate"]) && isNumber($_GET["validate"])) { $output .= "
"._NONVALMEMBERS."
"; if($confirm == "yes") { if(check_prefs($_GET['validate'])) dbquery("UPDATE ".TABLEPREFIX."fanfiction_authorprefs SET validated = '1' WHERE uid = '".$_GET['validate']."'"); else dbquery("INSERT INTO ".TABLEPREFIX."fanfiction_authorprefs(`uid`, `validated`) VALUES('".$_GET['validate']."', '1')"); $output .= write_message(_ACTIONSUCCESSFUL); } else if ($confirm == "no") { $output .= write_message(_ACTIONCANCELLED); } else { $output .= write_message(_CONFIRMVALIDATE."

[ "._YES." | "._NO." ]"); } } else if(isset($_GET["do"]) && $_GET['do'] == "add") { if(_AUTHORTABLE != TABLEPREFIX."fanfiction_authors as author") $output .= write_message("
"._FOREIGNAUTHORTABLE); $output .= "
"._ADDAUTHOR." [?]
"; } else if (isset($_POST['submit'])) { if(preg_match("!^[a-z0-9_ ]{3,30}$!i", $_POST['penname'])) { dbquery("INSERT INTO ".substr(_AUTHORTABLE, 0, strpos(_AUTHORTABLE, "as author"))."(penname, realname, email, admincreated, date) VALUES ('".escapestring(descript($_POST['penname']))."', '".escapestring(descript($_POST['realname']))."', '".escapestring(descript($_POST['email']))."', '1', now())"); $newuid = dbinsertid( ); if($logging) dbquery("INSERT INTO ".TABLEPREFIX."fanfiction_log (`log_action`, `log_uid`, `log_ip`, `log_type`, `log_timestamp`) VALUES('".escapestring(sprintf(_LOG_ADMIN_REG, descript($_POST['penname']), $newuid, USERPENNAME, USERUID, $_SERVER['REMOTE_ADDR']))."', '".USERUID. "', INET6_ATON('".$_SERVER['REMOTE_ADDR']."'), 'RG', " . time() . ")"); if(!$skin) { $skinquery = dbquery("SELECT skin FROM ".$settingsprefix."fanfiction_settings WHERE sitekey ='".SITEKEY."'"); list($skin) = dbrow($skinquery); } dbquery("INSERT INTO ".TABLEPREFIX."fanfiction_authorprefs(uid, userskin, storyindex, sortby) VALUES('$newuid', '$skin', '$displayindex', '$defaultsort')"); $output .= write_message(_ACTIONSUCCESSFUL); } else $output .= write_error(_BADUSERNAME); } else { $output .= "
"; if(isset($_GET['list'])) $list = $_GET['list']; else $list = false; $where = ""; if($list == "admincreated") { if(_AUTHORTABLE != TABLEPREFIX."fanfiction_authors as author") { $fieldtest = dbquery("SHOW COLUMNS FROM ".substr(_AUTHORTABLE, 0, strlen(_AUTHORTABLE) - 9)." LIKE 'admincreated'"); } if(isset($fieldtest) && !dbnumrows($fieldtest)) { $where = ""; $output .= write_message(_FUNCTIONDISABLED); $tpl->assign("output", $output); $tpl->printToScreen( ); dbclose( ); exit(); } else { $where = " WHERE author.admincreated = '1'"; $do = "release"; $output .= _INPUTBYADMIN; $message = write_message(_RELEASEAUTHORS); } } else if($list == "admins") { $where = " WHERE ap.level > 0"; $do = false; $authorlink = " "._ALLMEMBERS." | "._ADMINS." | "._AUTHORS." | "._INPUTBYADMIN."
"._NONVALMEMBERS." | "._VALMEMBERS." | "._LOCKMEMLIST." | "._UNLOCKMEMBERS."

"; $pagelink = "admin.php?action=members&do=list&list=$list&".($let ? "let=$let&" :""); include("includes/members_list.php"); if(_AUTHORTABLE != TABLEPREFIX."fanfiction_authors as author") { $fieldtest = dbquery("SHOW COLUMNS FROM ".substr(_AUTHORTABLE, 0, strlen(_AUTHORTABLE) - 9)." LIKE 'admincreated'"); if(dbnumrows($fieldtest)) $output .= write_message(""._ADDAUTHOR.""); } else $output .= write_message(""._ADDAUTHOR.""); if(isset($message)) $output .= $message; } ?>