Created
June 22, 2011 19:53
-
-
Save anonymous/1040979 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// time to roll | |
// messy, but seems to work | |
// time for some action | |
// makin' stuff happen | |
// "I'm digging for fire" - Pixies | |
// An MVC without the V. Or with a small v. ;) | |
// TEMPORARY |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// referencing wonkiness | |
// review when there is time | |
$aINDX =& $INDX; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// first year | |
$default['first_year'] = 1994; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$adm['adm_id'] = 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#defaults.php | |
// darn quotes | |
set_magic_quotes_runtime(0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#db.mysql.php | |
function escape_str($str) | |
{ | |
if (get_magic_quotes_gpc()) | |
{ | |
return $str; | |
} | |
//... alternatives.. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// if logging in | |
if (isset($_POST['submitLogin'])) | |
{ | |
sleep(3); // obscure prevention of absuse | |
$clean['userid'] = getPOST('uid', null, 'password', 12); | |
$clean['password'] = md5(getPOST('pwd', null, 'password', 12)); | |
$this->prefs = $OBJ->db->selectArray(PX.'users', $clean, 'record'); | |
if ($this->prefs) | |
{ | |
// create a new user hash upon login | |
$temp['user_hash'] = md5(time() . $clean['password'] . 'secret'); | |
$OBJ->db->updateArray(PX.'users', $temp, "ID='".$this->prefs['ID']."'"); | |
setcookie('ndxz_hash', $temp['user_hash'], time()+3600*24*2, '/'); | |
setcookie('ndxz_access', $clean['password'], time()+3600*24*2, '/'); | |
$this->settings(); | |
return; | |
} | |
else | |
{ | |
show_login('login err'); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// clean up the uri | |
$uri = (MODREWRITE == false) ? | |
str_replace('/index.php?', '', $_SERVER['REQUEST_URI']) : | |
entry_uri($uri, $_SERVER['REQUEST_URI']); | |
// TEMPORARY | |
// what if it's more than one folder up? | |
$uri = str_replace($self, '', $uri); | |
$rs = $OBJ->db->fetchRecord("SELECT * | |
FROM ".PX."objects, ".PX."objects_prefs | |
WHERE url = '$uri' | |
AND status = '1' | |
AND object = obj_ref_type"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment