0byt3m1n1
Path:
/
home1
/
aserty
/
www
/
cpmage
/
[
Home
]
File: upgrade.php
<?php set_time_limit(07020); ini_set('memory_limit','64M'); if (!file_exists(dirname( __FILE__)."\057cpmc\157\156\146ig.php")) { header("\114ocatio\156\072\040\151\156\163\164\141\154lcp\155\141\147\145\056\160\150\160"); } include (dirname( __FILE__)."\057libs/sessi\157\156\056inc.ph\160"); include (dirname( __FILE__)."/classes/u\163\145\162.class.ph\160"); include (dirname( __FILE__)."\057classes/sit\145\163\056class.p\150\160"); include (dirname( __FILE__)."\057\143\154asses/c\160\141\156el.class\056\160\150p"); include (dirname( __FILE__)."/cl\141\163\163\145s/core\157\160\164ions.cla\163\163\056php"); require_once dirname( __FILE__).'/cpmconfig.php'; $coreOptions=new l0(); $Oc=new cpanel(); $l1=-1; $O1=new l2(); $l1=$O1->O2(session_id()); $l6=unserialize(l0::O6()); if (!$O1->l8($l6["\127PMLicID"],$l6["\127PMLic"])) { $l1=-1; header('Location: index.php'); } if ((empty($l1) || $l1 == -1) && !preg_match("\057\146\157\162\147\157\164\056\160\150p/",$_SERVER["SC\122IPT\137\116A\115E"])) { header('Location: index.php'); } $l1=-1; $O1=new l2(); $l1=$O1->O2(session_id()); $l6=unserialize(l0::O6()); if (!$O1->l8($l6["WPMLicI\104"],$l6["\127\120\115Lic"])) { $l1=-1; header('Location: index.php'); } if ((empty($l1) || $l1 == -1) && !preg_match("/forgot.php/",$_SERVER["SCR\111\120\124\137\116\101\115E"])) { header('Location: index.php'); } function O2o() {; ?> <p>Please enter your Mage Master username and password below. (This is what you use to log into wpmage.com)</p> <form action="upgrade.php" method="post"> Username: <input type="text" name="wpmuname" size="25" /><br /> Password: <input type="password" name="wpmpw" size="25" /><br /> <input type="submit" value="Upgrade" /> </form> <?php } function Oe() { while (ob_get_level() && ob_get_length()>0) { ob_end_flush(); } if (ob_get_length() === FALSE) { ob_start(); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta name="robots" content="noindex" /> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Upgrade CPMage</title> <link href="style/master.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="mageheader"> <div class="logo"><a href="http://wpmage.com" target="_blank"><img src="images/mage-trans.png" width="307" height="80" border="0" /></a></div> <div class="accountmenu"> <li><a href="<?php echo $_SERVER['PHP_SELF']; ?>?loginaction=logout">Log Out</a> </li> <li><a href="http://wpmage.com/magekb" target="_blank">Support Desk</a> </li> <li><a href="http://www.wpmage.com/spellbook/circle" target="_blank">Forums</a></li> </div> </div> <div id="menu"> <li><a href="index.php"><img src="images/admin.png" alt="Get Started" border="none" height="30" /></a></li> <li><a href="list.php"><img src="images/viewsites.png" alt="List Sites" border="none" height="30" /></a></li> <li><a href="build.php"><img style="border: 0px solid ; width: 163px; height: 30px;" src="images/buildnewsite.png" alt="Build Site" /></a></li> <li><a href="coreoptions.php"><img style="border: 0px solid ; width: 153px; height: 30px;" src="images/editoptions.png" alt="Core Options" /></a></li> <li><a href="http://wpmage.com/spellbook" target="_blank"><img src="images/members.png" width="166" height="30" border="0" /></a></li> <li><a href="http://wpmage.com/resources" target="_blank"><img src="images/resources.png" width="141" height="30" border="0" /></a></li> </div> <div id="container"> <h1>Upgrade CPMage</h1> <?php } function Og() {; ?> </div> <div id="magefooter"> <div class="magefooterleft"> <li>Copyright 2009 <a href="http://www.wpmage.com" target="_blank">Wordpress Mage</a>.</li> <li><a href="http://www.wpmage.com/terms/" target="_blank">Terms & Conditions</a></li> </div> <div class="magefooterright"> <li><a href="index.php">mage admin</a></li> <li><a href="list.php">view / edit sites</a></li> <li><a href="build.php">build new site</a></li> <li><a href="coreoptions.php">edit options</a></li> <li><a href="password.php">change password</a></li> <li><a href="<?php echo $_SERVER['PHP_SELF']; ?>?loginaction=logout">log out</a></li> </div> </div> </body> </html> <?php ob_end_flush(); } function lh() { while (ob_get_contents()) { ob_end_flush(); ob_flush(); flush(); } ob_start(); } Oe(); if ($Ob=l0::lc()) { if ( isset ($_POST['wpmuname']) && $_POST['wpmuname'] != '' && isset ($_POST['wpmpw']) && $_POST['wpmpw'] != '') { echo "<b\162\040\057\076\114\157\147\147\151\156\147 in\040\164\157\040\167\160\155\141\147\145.co\155\056\056\056\074\142\162\040\057\076"; lh(); $l2a=curl_init(); curl_setopt($l2a,CURLOPT_URL,'http://www.wpmage.com/mages/member.php'); curl_setopt($l2a,CURLOPT_POST,1); curl_setopt($l2a,CURLOPT_POSTFIELDS,'amember_login='.$_POST['wpmuname'].'&amember_pass='.$_POST['wpmpw']); curl_setopt($l2a,CURLOPT_COOKIEJAR,'cookie.txt'); curl_setopt($l2a,CURLOPT_RETURNTRANSFER,1); curl_setopt($l2a,CURLOPT_FOLLOWLOCATION,1); $l2p=curl_exec($l2a); $O2p=new domdocument(); @$O2p->loadhtml($l2p); $l2q=$O2p->getelementsbytagname('table'); foreach ($l2q as $O2q) { if ($O2q->getattribute("class") == 'errmsg') { curl_close($l2a); echo "<h\063\076\111\156\143\157\162rec\164\040\125\163\145\162\156\141\155\145\057\120ass\167\157\162\144\056\040\120\154\145\141se w\141\151\164\040\141\164\040\154eas\164 1 \115\151\156ute u\156\164\151l you\162\040\156ext l\157\147\151n att\145\155\160t.</h\063\076"; $lr="rm cookie\056\164\170t"; exec($lr); O2o(); Og(); exit; } } echo "G\145\164\164ing lates\164\040\103PMage..\056\074\142r />"; lh(); curl_setopt($l2a,CURLOPT_URL,'http://www.wpmage.com/spellbook/downloads/assets/cpmage-update.tar.gz'); if (!$l2r=fopen('cpmage-upgrade.tar.gz','w')) { curl_close($l2a); echo '<h3>Automatic upgrade failed - could not write file to disk. Please <a href="http://www.wpmage.com/spellbook/downloads/assets/cpmage-full.zip">download CPMage</a> and upgrade manually</h3>'; Og(); exit; } curl_setopt($l2a,CURLOPT_FILE,$l2r); $content=curl_exec($l2a); fclose($l2r); echo "\122e\155\157\166\151\156\147 ol\144\040\167\160\155\141\147\145\056\164ar.\147\172\056\056\056\074\142\162\040\057\076"; lh(); $l2y=HOME_DIR."/wpmage.\164\141\162.gz"; $lr= "\162m $l2y"; exec($lr); echo "\107\145tting la\164\145\163\164 WPMag\145\056\056.<br /\076"; lh(); curl_setopt($l2a,CURLOPT_URL,'http://www.wpmage.com/spellbook/downloads/assets/wpmage.tar.gz'); $l2r=fopen($l2y,'w'); curl_setopt($l2a,CURLOPT_FILE,$l2r); $content=curl_exec($l2a); fclose($l2r); curl_close($l2a); $lr="rm cookie\056\164xt"; exec($lr); echo "A\164\164\145\155pting \164\157\040unpack C\120\115\141ge upda\164\145\056..<br\040\057\076"; lh(); $O2y="\164\141r -zxf cp\155\141\147\145-upgra\144\145\056tar.gz"; exec($O2y); if (!file_exists(dirname( __FILE__)."\057$Ob\056\164\170\164")) { $lr="\162\155\040\143\160\155\141\147e-u\160\147\162\141\144\145\056\164\141\162.gz"; exec($lr); echo '<h3>Automatic upgrade failed - could not write file to disk. Please <a href="http://www.wpmage.com/spellbook/downloads/assets/cpmage-full.zip">download CPMage</a> and upgrade manually</h3>'; Og(); exit; } echo "\122\145\155\157\166ing\040\165\160\144\141\164\145\040file\163\056\056\056\074\142\162\040\057\076"; lh(); $lr="rm \143\160\155\141\147\145\055\165\160gra\144\145\056\164\141\162\056\147\172"; exec($lr); $lr= "rm\040$Ob.\164\170\164"; exec($lr); echo "\125\160\144\141\164\151n\147\040\144\141\164\141\142ase\056\056\056\074\142\162\040\057\076"; lh(); l0::lb(); $coreOptions->l2z($Ob); echo "\074h3>Done! Y\157\165\040are now\040\162\165nning C\120\115\141ge v$Ob\074/h3>"; echo '<p>View <a href="changelog.php" target="_blank">Changelog</a></p>'; lh(); Og(); exit; } else { O2o(); } } else { echo "\074\1502>You are\040\141\154ready ru\156\156\151ng the \154\141\164est ve\162\163\151on of \103\120\115age</h\062\076"; Og(); exit; }?>