コード例 #1
0
ファイル: layout.php プロジェクト: jeremy-cayrasso/dtc
function skin_LayoutAdminPage()
{
    global $rub;
    global $adm_login;
    global $adm_pass;
    global $conf_session_expir_minute;
    global $pro_mysql_config_table;
    global $pro_mysql_tik_admins_table;
    global $conf_skin;
    global $top_commands;
    global $adm_random_pass;
    global $page_metacontent;
    global $meta;
    global $confirm_javascript;
    global $java_script;
    global $skinCssString;
    global $console;
    ///////////////////////
    // Make All the page //
    ///////////////////////
    switch ($rub) {
        case "crm":
            // CRM TOOL
            $admin_list = DTCRMlistClients();
            $client_editor = DTCRMeditClients();
            if (isset($_REQUEST["id"]) && $_REQUEST["id"] != "" && $_REQUEST["id"] != 0) {
                $client_editor .= DTCRMclientAdmins();
            }
            $zemain_content = '
<table class="box_wnb" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td class="box_wnb_nb" valign="top">
    	<div class="box_wnb_nb_title"><div class="box_wnb_nb_title_left"><div class="box_wnb_nb_title_right"><div class="box_wnb_nb_title_mid">' . _("Customers list") . '</div></div></div></div>
    	' . $admin_list . '
    </td>
    <td class="box_wnb_content" valign="top">
      <div class="box_wnb_content_container">
      <h2>' . _("Customer's address") . '</h2>
      ' . $client_editor . '
      </div>
    </td>
  </tr>
  <tr>
    <td class="box_wnb_nb_bottom"></td>
    <td class="box_wnb_content_bottom" valign="top"></td>
  </tr>
</table>';
            break;
        case "renewal":
            $out = drawRenewalTables();
            $zemain_content = skin($conf_skin, $out, _("Customer renewals"));
            break;
        case "monitor":
            // Monitor button
            $out = drawAdminMonitor();
            $zemain_content = skin($conf_skin, $out, _("Customer's bandwidth consumption"));
            break;
        case "graph":
            $zemain_content = skin($conf_skin, drawRrdtoolGraphs(), _("Server statistic graphs"));
            break;
        case "generate":
            // Gen Config Files
            $mainFrameCells[] = skin($conf_skin, $top_commands, _("Launching the configuration files generation"));
            $the_iframe = "<br><br>" . _("Please note that you need to create at least one email and one FTP account in order to have the daemon status working!") . "<br><IFRAME src=\"deamons_state.php\" width=\"100%\" height=\"135\"></iframe>";
            $mainFrameCells[] = skin($conf_skin, $the_iframe, _("Deamons states"));
            // fixed bug by seeb
            // The console
            $mainFrameCells[] = skinConsole();
            $zemain_content = makeVerticalFrame($mainFrameCells);
            break;
        case "config":
            // Global Config
            $zemain_content = '
<table class="box_wnb" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td class="box_wnb_nb" valign="top">
    	<div class="box_wnb_nb_title"><div class="box_wnb_nb_title_left"><div class="box_wnb_nb_title_right"><div class="box_wnb_nb_title_mid">' . _("Menu") . '</div></div></div></div>
    	' . drawDTCConfigMenu() . '
    </td>
    <td class="box_wnb_content" valign="top">
    	 <div class="box_wnb_content_container">
	  <h2>' . _("DTC Configuration") . '</h2>
' . drawDTCConfigForm() . '
	</div>
    </td>
  </tr>
  <tr>
    <td class="box_wnb_nb_bottom"></td>
    <td class="box_wnb_content_bottom" valign="top"></td>
  </tr>
</table>';
            break;
        case "product":
            $bla = productManager();
            $zemain_content = skin($conf_skin, $bla, _("Hosting product manager"));
            break;
        case "user":
            // User Config
        // User Config
        case "domain_config":
        case "adminedit":
        default:
            // No rub selected
            $bwoup_user_edit = bwoupUserEditForms($adm_login, $adm_pass);
            if (isset($adm_random_pass)) {
                $rand = $adm_random_pass;
            } else {
                $rand = getRandomValue();
                $adm_random_pass = $rand;
                $expirationTIME = mktime() + 60 * $conf_session_expir_minute;
                $q = "UPDATE {$pro_mysql_tik_admins_table} SET pass_next_req='{$rand}', pass_expire='{$expirationTIME}' WHERE pseudo='" . $_SERVER["PHP_AUTH_USER"] . "';";
                $r = mysql_query($q) or die("Cannot execute query \"{$q}\" !");
            }
            $skinedConsole = '<table cellpadding="0" cellspacing="0" class="console">
	  <tr><td class="console_title">' . _("Console output") . ' :</td>
	  </tr><tr>		<td class="console_output"><pre>' . $_SERVER['SERVER_NAME'] . ':&gt;_' . $console . '<br><span id="console_content" class="console_content"></span></pre></td></tr></table>';
            $adm_list = adminList($rand) . '
	  <div class="voider"></div>
	  <br /><br />
		<div class="voider"></div>';
            $zemain_content = '
<table class="box_wnb" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td class="box_wnb_nb" valign="top">
    	<div class="box_wnb_nb_title"><div class="box_wnb_nb_title_left"><div class="box_wnb_nb_title_right"><div class="box_wnb_nb_title_mid">' . _("Admins list") . '</div></div></div></div>
    	' . $adm_list . '
    </td>
    <td class="box_wnb_content" valign="top">
      <div class="box_wnb_content_container">
      <h2>' . _("User administration") . " {$adm_login}" . '</h2>
      ' . $bwoup_user_edit . $skinedConsole . '
      </div>
    </td>
  </tr>
  <tr>
    <td class="box_wnb_nb_bottom"></td>
    <td class="box_wnb_content_bottom" valign="top"></td>
  </tr>
</table>';
            break;
    }
    $dtc_main_menu = skin_Navbar();
    $anotherFooter = anotherFooter("Footer content<br><br>");
    echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html>\n<head>\n<title>DTC: Admin: " . $_SERVER['SERVER_NAME'] . "</title>\n{$page_metacontent}\n{$meta}\n</head>\n<body id=\"page\" leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\">\n\t  <div id=\"outerwrapper\">\n    <div id=\"wrapper\">\n\n" . makePreloads() . "\n{$confirm_javascript}\n{$java_script}\n<link rel=\"stylesheet\" href=\"gfx/skin/bwoup/skin.css\" type=\"text/css\">\n{$skinCssString}\n\n" . anotherTopBanner("DTC", "yes") . $dtc_main_menu . "\n<div id=\"content\">" . $zemain_content . "</div>\n<div id=\"footer\">" . anotherFooter("Footer content<br><br>") . "</div>\n    </div>\n</div>\n</body>\n</html>";
}
コード例 #2
0
ファイル: getSocialUser.php プロジェクト: tomgsmith99/j-rug
function getSingleItem($kindOfItem)
{
    global $interests;
    global $books;
    global $movies;
    global $music;
    if ($kindOfItem == "interest") {
        $item = getRandomValue($interests);
    }
    if ($kindOfItem == "book") {
        $j = array_rand($books);
        $item = $books[$j];
    }
    if ($kindOfItem == "movie") {
        $j = array_rand($movies);
        $item = $movies[$j];
    }
    if ($kindOfItem == "music") {
        $j = array_rand($music);
        $item = $music[$j];
    }
    return $item;
}
コード例 #3
0
<?php

require_once 'bootstrap.php';
/**
 * @var $vulcanoXsdToXmlGenerator VulcanoXsdToXmlGenerator
 */
$vulcanoXsdToXmlGenerator->setOption(VulcanoXsdToXmlGenerator::OPTION_HOLD_ON_MISSING_DATA_NODE_ATTRIBUTE);
$vulcanoXsdToXmlGenerator->unsetOption(VulcanoXsdToXmlGenerator::OPTION_HOLD_ON_MISSING_DATA_NODE_ATTRIBUTE);
$vulcanoXsdToXmlGenerator->markNodeAsOptional('vehicle');
for ($loop = 0; $loop < 5; ++$loop) {
    $vulcanoXsdToXmlGenerator->appendNodeData('donkey', array('name' => getRandomValue(), 'birthday' => getRandomValue()));
    $vulcanoXsdToXmlGenerator->appendNodeData('cow', array('name' => getRandomValue(), 'birthday' => getRandomValue()));
    $vulcanoXsdToXmlGenerator->appendNodeData('pic', array('name' => getRandomValue(), 'birthday' => getRandomValue()));
}
echo $vulcanoXsdToXmlGenerator->generate();
コード例 #4
0
    $params['decode_bodies'] = true;
    $params['decode_headers'] = true;
    $decoder = new Mail_mimeDecode($input);
    $structure = $decoder->decode($params);
    return $structure;
}
// Read the email from standard input
$msg = "";
$fp = fopen('php://stdin', 'r');
while ($line = fgets($fp, 4096)) {
    $msg .= $line;
}
$DEBUG_ME = 0;
if ($DEBUG_ME == 1) {
    @mkdir("/tmp/support/");
    $debug_fp = fopen("/tmp/support/" . date('Y-m-d') . "_" . date('H-m-i') . "_" . getRandomValue() . ".txt", "w+");
    fwrite($debug_fp, $msg);
    fclose($debug_fp);
}
// Decode the msg using php-mail-mime
$stt = decodeEmail($msg);
// Get the From: header email
$flag = preg_match_all("/[\\._a-zA-Z0-9+-]+@[\\._a-zA-Z0-9-]+/i", $stt->headers["from"], $matches);
if ($flag == 0 || sizeof($matches) != 1) {
    echo "No email found in From! :(\n";
    exit(1);
}
$email_from = $matches[0][0];
// Do nothing if there's a mail from an auto-responder
if (isset($stt->headers["X-AutoReply-From"]) || isset($stt->headers["X-Mail-Autoreply"])) {
    exit(0);
コード例 #5
0
function skin_LayoutAdminPage_Default()
{
    global $rub;
    global $adm_login;
    global $adm_pass;
    global $conf_session_expir_minute;
    global $pro_mysql_config_table;
    global $conf_skin;
    global $top_commands;
    global $adm_random_pass;
    $anotherTopBanner = anotherTopBanner("DTC", "yes");
    ///////////////////////
    // Make All the page //
    ///////////////////////
    switch ($rub) {
        case "crm":
            // CRM TOOL
            $rightFrameCells[] = skin($conf_skin, DTCRMeditClients(), _("Customer's address"));
            if (isset($_REQUEST["id"]) && $_REQUEST["id"] != "" && $_REQUEST["id"] != 0) {
                $rightFrameCells[] = skin($conf_skin, DTCRMclientAdmins(), _("Customer's administrators"));
            }
            $rightFrame = makeVerticalFrame($rightFrameCells);
            $leftFrameCells[] = skin($conf_skin, DTCRMlistClients(), _("Customers list"));
            $leftFrame = makeVerticalFrame($leftFrameCells);
            $zemain_content = anotherLeftFrame($leftFrame, $rightFrame);
            break;
        case "renewal":
            $out = drawRenewalTables();
            $zemain_content = skin($conf_skin, $out, _("Customer renewals"));
            break;
        case "monitor":
            // Monitor button
            $out = drawAdminMonitor();
            $zemain_content = skin($conf_skin, $out, _("Customer's bandwidth consumption"));
            break;
        case "graph":
            $zemain_content = skin($conf_skin, drawRrdtoolGraphs(), _("Server statistic graphs"));
            break;
        case "generate":
            // Gen Config Files
            $mainFrameCells[] = skin($conf_skin, $top_commands, _("Launching the configuration files generation"));
            $the_iframe = "<br><br>" . _("Please note that you need to create at least one email and one FTP account in order to have the daemon status working!") . "<br><IFRAME src=\"deamons_state.php\" width=\"100%\" height=\"135\"></iframe>";
            $mainFrameCells[] = skin($conf_skin, $the_iframe, _("Deamons states"));
            // fixed bug by seeb
            // The console
            $mainFrameCells[] = skinConsole();
            $zemain_content = makeVerticalFrame($mainFrameCells);
            break;
        case "config":
            // Global Config
            $chooser_menu = drawDTCConfigMenu();
            $leftFrameCells[] = skin($conf_skin, $chooser_menu, "Menu");
            $leftFrame = makeVerticalFrame($leftFrameCells);
            $rightFrameCells[] = skin($conf_skin, drawDTCConfigForm(), _("DTC Configuration"));
            $rightFrame = makeVerticalFrame($rightFrameCells);
            $zemain_content = anotherLeftFrame($leftFrame, $rightFrame);
            break;
        case "product":
            $bla = productManager();
            $zemain_content = skin($conf_skin, $bla, _("Hosting product manager"));
            break;
        case "user":
            // User Config
        // User Config
        case "domain_config":
        case "adminedit":
        default:
            // No rub selected
            // A virtual admin edition
            // We have to call it first, in case it will generate a random pass (edition of an admin with inclusion of user's panel)
            $rightFrameCells[] = userEditForms($adm_login, $adm_pass);
            $rightFrameCells[] = skinConsole();
            $rightFrame = makeVerticalFrame($rightFrameCells);
            // Our list of admins
            // If random password was not set before this, we have to calculate it now!
            if (isset($adm_random_pass)) {
                $rand = $adm_pass;
            } else {
                $rand = getRandomValue();
                $expirationTIME = mktime() + 60 * $conf_session_expir_minute;
                $q = "UPDATE {$pro_mysql_config_table} SET root_admin_random_pass='******', pass_expire='{$expirationTIME}';";
                $r = mysql_query($q) or die("Cannot execute query \"{$q}\" !");
            }
            $leftFrameCells[] = skin($conf_skin, adminList($rand), _("Admins list"));
            // Make the frame
            $leftFrame = makeVerticalFrame($leftFrameCells);
            $zemain_content = anotherLeftFrame($leftFrame, $rightFrame);
            break;
    }
    if (function_exists("skin_Navbar")) {
        $dtc_main_menu = skin_Navbar();
    } else {
        $dtc_main_menu = skin_Navbar_Default();
    }
    $the_page[] = skin($conf_skin, $dtc_main_menu, _("Domain Technologie Control : root admin console"));
    $the_page[] = $zemain_content;
    $pageContent = makeVerticalFrame($the_page);
    $anotherFooter = anotherFooter("Footer content<br><br>");
    if (!isset($anotherHilight)) {
        $anotherHilight = "";
    }
    if (!isset($anotherMenu)) {
        $anotherMenu = "";
    }
    echo anotherPage("admin:", "", $anotherHilight, makePreloads(), $anotherTopBanner, $anotherMenu, $pageContent, $anotherFooter);
}
コード例 #6
0
ファイル: getUserBasics.php プロジェクト: tomgsmith99/j-rug
function getCountry()
{
    global $countries;
    $country = getRandomValue($countries, max(array_keys($countries)));
    return $country;
}
コード例 #7
0
ファイル: dtc_functions.php プロジェクト: jeremy-cayrasso/dtc
function createSupportHash()
{
    global $pro_mysql_tik_queries_table;
    $n = 1;
    while ($n != 0) {
        $hash = getRandomValue();
        $q = "SELECT id FROM {$pro_mysql_tik_queries_table} WHERE hash='{$hash}';";
        $r = mysql_query($q) or die("Cannot execute query \"{$q}\" ! line: " . __LINE__ . " file: " . __FILE__ . " sql said: " . mysql_error());
        $n = mysql_num_rows($r);
    }
    return $hash;
}
コード例 #8
0
ファイル: layout.php プロジェクト: jeremy-cayrasso/dtc
function skin_LayoutAdminPage()
{
    global $rub;
    global $adm_login;
    global $adm_pass;
    global $conf_session_expir_minute;
    global $pro_mysql_config_table;
    global $pro_mysql_tik_admins_table;
    global $conf_skin;
    global $top_commands;
    global $adm_random_pass;
    global $page_metacontent;
    global $meta;
    global $confirm_javascript;
    global $java_script;
    global $skinCssString;
    global $console;
    ///////////////////////
    // Make All the page //
    ///////////////////////
    switch ($rub) {
        case "crm":
            // CRM TOOL
            $admin_list = DTCRMlistClients();
            $client_editor = DTCRMeditClients();
            if (isset($_REQUEST["id"]) && $_REQUEST["id"] != "" && $_REQUEST["id"] != 0) {
                $client_editor .= DTCRMclientAdmins();
            }
            // main content
            $zemain_content = '
<table class="box_wnb" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td class="box_wnb_nb" valign="top">
			<div class="box_wnb_nb_title_left"><div class="box_wnb_nb_title_mid">' . _("Customers list") . '</div></div>
			' . $admin_list . '
		</td>
		<td class="box_wnb_content" valign="top">
			<table class="c_tht" cellpadding="0" cellspacing="0">
				<tr>
					<td class="c_thl-1" nowrap="nowrap">&nbsp;</td>
					<td class="c_thm-1 hleft" nowrap="nowrap">&nbsp;</td>
					<td class="c_thr-1" nowrap="nowrap">&nbsp;</td>
				</tr>
				<tr>
					<td class="c_bord-left" nowrap="nowrap"></td>
					<td class="c_back">
						<div class="thtitle">' . _("Customer's address") . '</div><br />
						' . $client_editor . '
					</td>
					<td class="c_bord-right" nowrap="nowrap"></td>
				</tr>
				<tr>
					<td class="c_tbl-1" nowrap="nowrap"></td>
					<td class="c_tbm-1 hleft" nowrap="nowrap">&nbsp;</td>
					<td class="c_tbr-1" nowrap="nowrap"></td>
				</tr>
			</table>
		</td>
	</tr>
</table>';
            break;
            //renewal page skin
        //renewal page skin
        case "renewal":
            $out = drawRenewalTables();
            $zemain_content = '
<table class="c_tht" cellpadding="0" cellspacing="0">
	<tr>
		<td class="c_thl-1" nowrap="nowrap">&nbsp;</td>
		<td class="c_thm-1 hleft" nowrap="nowrap">' . _("Customer renewals") . '</td>
		<td class="c_thr-1" nowrap="nowrap">&nbsp;</td>
	</tr>
	<tr>
		<td class="c_bord-left" nowrap="nowrap"></td>
		<td class="c_back">
			' . drawRenewalTables() . '
		</td>
		<td class="c_bord-right" nowrap="nowrap"></td>
	</tr>
	<tr>
		<td class="c_tbl-1" nowrap="nowrap"></td>
		<td class="c_tbm-1 hleft" nowrap="nowrap">&nbsp;</td>
		<td class="c_tbr-1" nowrap="nowrap"></td>
	</tr>
</table>';
            break;
            // server monitor skin
        // server monitor skin
        case "monitor":
            // Monitor button
            $out = drawAdminMonitor();
            $zemain_content = '
<table class="c_tht" cellpadding="0" cellspacing="0">
	<tr>
		<td class="c_thl-1" nowrap="nowrap">&nbsp;</td>
		<td class="c_thm-1 hleft" nowrap="nowrap">' . _("Customer's bandwidth consumption") . '</td>
		<td class="c_thr-1" nowrap="nowrap">&nbsp;</td>
	</tr>
	<tr>
		<td class="c_bord-left" nowrap="nowrap"></td>
		<td class="c_back">
			' . drawAdminMonitor() . '
		</td>
		<td class="c_bord-right" nowrap="nowrap"></td>
	</tr>
	<tr>
		<td class="c_tbl-1" nowrap="nowrap"></td>
		<td class="c_tbm-1 hleft" nowrap="nowrap">&nbsp;</td>
		<td class="c_tbr-1" nowrap="nowrap"></td>
	</tr>
</table>';
            break;
            // server RDDtool graphs skin
        // server RDDtool graphs skin
        case "graph":
            $zemain_content = '
<table class="c_tht" cellpadding="0" cellspacing="0">
	<tr>
		<td class="c_thl-1" nowrap="nowrap">&nbsp;</td>
		<td class="c_thm-1 hleft" nowrap="nowrap">' . _("Server statistic graphs") . '</td>
		<td class="c_thr-1" nowrap="nowrap">&nbsp;</td>
	</tr>
	<tr>
		<td class="c_bord-left" nowrap="nowrap"></td>
		<td class="c_back">
			' . drawRrdtoolGraphs() . '
		</td>
		<td class="c_bord-right" nowrap="nowrap"></td>
	</tr>
	<tr>
		<td class="c_tbl-1" nowrap="nowrap"></td>
		<td class="c_tbm-1 hleft" nowrap="nowrap">&nbsp;</td>
		<td class="c_tbr-1" nowrap="nowrap"></td>
	</tr>
</table>';
            break;
            // deamon gen skin
        // deamon gen skin
        case "generate":
            // Gen Config Files
            $mainFrameCells[] = '
<table class="c_tht" cellpadding="0" cellspacing="0">
	<tr>
		<td class="c_thl-1" nowrap="nowrap">&nbsp;</td>
		<td class="c_thm-1 hleft" nowrap="nowrap">' . _("Launching the configuration files generation") . '</td>
		<td class="c_thr-1" nowrap="nowrap">&nbsp;</td>
	</tr>
	<tr>
		<td class="c_bord-left" nowrap="nowrap"></td>
		<td class="c_back">' . $top_commands . ' </td>
		<td class="c_bord-right" nowrap="nowrap"></td>
	</tr>
	<tr>
		<td class="c_tbl-1" nowrap="nowrap"></td>
		<td class="c_tbm-1 hleft" nowrap="nowrap">&nbsp;</td>
		<td class="c_tbr-1" nowrap="nowrap"></td>
	</tr>
</table><br />';
            $the_iframe = "<br /><IFRAME src=\"deamons_state.php\" width=\"100%\" height=\"135\"></iframe>";
            $mainFrameCells[] = '
<table class="c_tht" cellpadding="0" cellspacing="0">
	<tr>
		<td class="c_thl-1" nowrap="nowrap">&nbsp;</td>
		<td class="c_thm-1 hleft" nowrap="nowrap">' . _("Deamons states") . '</td>
		<td class="c_thr-1" nowrap="nowrap">&nbsp;</td>
	</tr>
	<tr>
		<td class="c_bord-left" nowrap="nowrap"></td>
		<td class="c_back">' . $the_iframe . '</td>
		<td class="c_bord-right" nowrap="nowrap"></td>
	</tr>
	<tr>
		<td class="c_tbl-1" nowrap="nowrap"></td>
		<td class="c_tbm-1 hleft" nowrap="nowrap">&nbsp;</td>
		<td class="c_tbr-1" nowrap="nowrap"></td>
	</tr>
</table><br />';
            // The console
            $mainFrameCells[] = '
<table class="c_tht" cellpadding="0" cellspacing="0">
	<tr>
		<td class="c_thl-1" nowrap="nowrap">&nbsp;</td>
		<td class="c_thm-1 hleft" nowrap="nowrap">&nbsp;</td>
		<td class="c_thr-1" nowrap="nowrap">&nbsp;</td>
	</tr>
	<tr>
		<td class="c_bord-left" nowrap="nowrap"></td>
		<td class="c_back">' . skinConsole() . '</td>
		<td class="c_bord-right" nowrap="nowrap"></td>
	</tr>
	<tr>
		<td class="c_tbl-1" nowrap="nowrap"></td>
		<td class="c_tbm-1 hleft" nowrap="nowrap">&nbsp;</td>
		<td class="c_tbr-1" nowrap="nowrap"></td>
	</tr>
</table><br />';
            $zemain_content = makeVerticalFrame($mainFrameCells);
            break;
            // main config skin
        // main config skin
        case "config":
            // Global Config
            $zemain_content = '
<table class="box_wnb" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td class="box_wnb_nb" valign="top">
			<div class="dtctitle">' . "Menu" . '</div>
			' . drawDTCConfigMenu() . '
		</td>
		<td class="box_wnb_content" valign="top">
			<table class="c_tht" cellpadding="0" cellspacing="0">
				<tr>
					<td class="c_thl-1" nowrap="nowrap">&nbsp;</td>
					<td class="c_thm-1 hleft" nowrap="nowrap">&nbsp;</td>
					<td class="c_thr-1" nowrap="nowrap">&nbsp;</td>
				</tr>
				<tr>
					<td class="c_bord-left" nowrap="nowrap"></td>
					<td class="c_back">
						<div class="box_wnb_content_container">
							<div class="thtitle">' . _("DTC Configuration") . '</div><br />
							' . drawDTCConfigForm() . '
						</div>
					</td>
					<td class="c_bord-right" nowrap="nowrap"></td>
				</tr>
				<tr>
					<td class="c_tbl-1" nowrap="nowrap"></td>
					<td class="c_tbm-1 hleft" nowrap="nowrap">&nbsp;</td>
					<td class="c_tbr-1" nowrap="nowrap"></td>
				</tr>
			</table>
		</td>
	</tr>
</table>';
            break;
            // product setting page skin
        // product setting page skin
        case "product":
            $bla = productManager();
            $zemain_content = '<table class="c_tht" cellpadding="0" cellspacing="0">
			<tr>
				<td class="c_thl-1" nowrap="nowrap">&nbsp;</td>
				<td class="c_thm-1 hleft" nowrap="nowrap">' . _("Hosting product manager") . '</td>
				<td class="c_thr-1" nowrap="nowrap">&nbsp;</td>
			</tr>

			<tr>
				<td class="c_bord-left" nowrap="nowrap"></td>
				<td class="c_back">' . $bla . '</td>
				<td class="c_bord-right" nowrap="nowrap"></td>
			</tr>

			<tr>
				<td class="c_tbl-1" nowrap="nowrap"></td>
				<td class="c_tbm-1 hleft" nowrap="nowrap">&nbsp;</td>
				<td class="c_tbr-1" nowrap="nowrap"></td>
			</tr>
		</table>';
            break;
        case "user":
            // User Config
        // User Config
        case "domain_config":
            // admin home page skin
        // admin home page skin
        case "adminedit":
        default:
            // No rub selected
            $bwoup_user_edit = bwoupUserEditForms($adm_login, $adm_pass);
            if (isset($adm_random_pass)) {
                $rand = $adm_random_pass;
            } else {
                $rand = getRandomValue();
                $expirationTIME = mktime() + 60 * $conf_session_expir_minute;
                $q = "UPDATE {$pro_mysql_tik_admins_table} SET pass_next_req='{$rand}', pass_expire='{$expirationTIME}' WHERE pseudo='" . $_SERVER["PHP_AUTH_USER"] . "';";
                $r = mysql_query($q) or die("Cannot execute query \"{$q}\" !");
                $adm_random_pass = $rand;
            }
            $skinedConsole = '<table cellpadding="0" cellspacing="0" class="console">
		<tr>
			<td class="console_title">' . _("Console outputi") . ' :</td>
		</tr>
		<tr>
			<td class="console_output"><pre>' . $_SERVER['SERVER_NAME'] . ':&gt;_' . $console . '<br /><span id="console_content" class="console_content"></span></pre></td>
		</tr></table>';
            $adm_list = adminList($rand) . '
	  <div class="voider"></div>
	  <br /><br />
		<div class="voider"></div>';
            $zemain_content = '
<table class="box_wnb" border="0" cellpadding="0" cellspacing="0">
  <tr>
	<td class="box_wnb_nb" valign="top">
		<div class="box_wnb_nb_title_left"><div class="dtctitle">' . _("Admins list") . '</div></div>
		' . $adm_list . '
	</td>
	<td class="box_wnb_content" valign="top">
		<table class="c_tht" cellpadding="0" cellspacing="0">
			<tr>
				<td class="c_thl-1" nowrap="nowrap">&nbsp;</td>
				<td class="c_thm-1 hleft" nowrap="nowrap">&nbsp;</td>
				<td class="c_thr-1" nowrap="nowrap">&nbsp;</td>
			</tr>
			<tr>
				<td class="c_bord-left" nowrap="nowrap"></td>
				<td class="c_back">
					<div class="thtitle">' . _("User administration") . '</div><br />
					' . $bwoup_user_edit . $skinedConsole . '
				</td>
				<td class="c_bord-right" nowrap="nowrap"></td>
			</tr>
			<tr>
				<td class="c_tbl-1" nowrap="nowrap"></td>
				<td class="c_tbm-1 hleft" nowrap="nowrap">&nbsp;</td>
				<td class="c_tbr-1" nowrap="nowrap"></td>
			</tr>
		</table>
	</td>
  </tr>
</table>';
            break;
    }
    // admin page general layout
    $dtc_main_menu = skin_Navbar();
    $anotherFooter = anotherFooter("Footer content<br /><br />");
    echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" dir=\"ltr\" lang=\"en\" xml:lang=\"en\">\n<head>\n<title>DTC: Admin: " . $_SERVER['SERVER_NAME'] . "</title>\n{$page_metacontent}\n{$meta}\n<link rel=\"stylesheet\" href=\"gfx/skin/paperboard/skin.css\" type=\"text/css\" media=\"all\" />\n</head>\n<body id=\"page\">\n<div id=\"outerwrapper\">\n\t<div id=\"wrapper\">\n\t\t" . makePreloads() . "\n\t\t{$confirm_javascript}\n\t\t{$java_script}\n\t\t{$skinCssString}\n\t\t" . anotherTopBanner("DTC", "yes") . $dtc_main_menu . "\n\t\t<table class=\"tht\" cellpadding=\"0\" cellspacing=\"0\">\n\t\t\t<tr>\n\t\t\t\t<td class=\"thl-1\" nowrap=\"nowrap\">&nbsp;</td>\n\t\t\t\t<td class=\"thm-1 hleft\" nowrap=\"nowrap\">&nbsp;</td>\n\t\t\t\t<td class=\"thr-1\" nowrap=\"nowrap\">&nbsp;</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td class=\"bord-left\" nowrap=\"nowrap\"></td>\n\t\t\t\t<td class=\"w-full\">" . $zemain_content . "</td>\n\t\t\t\t<td class=\"bord-right\" nowrap=\"nowrap\"></td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td class=\"tbl-1\" nowrap=\"nowrap\"></td>\n\t\t\t\t<td class=\"tbm-1 hleft\" nowrap=\"nowrap\">&nbsp;</td>\n\t\t\t\t<td class=\"tbr-1\" nowrap=\"nowrap\"></td>\n\t\t\t</tr>\n\t\t</table>\n\t\t<div id=\"footer\">" . anotherFooter("Footer content<br /><br />") . "PaperBoard template for DTC made by <a href=\"http://www.labestiole.net\" title=\"la bestiole\" target=\"_blank\">cali</a></div>\n\t</div>\n</div>\n</body>\n</html>";
}
コード例 #9
0
ファイル: pay_functions.php プロジェクト: jeremy-cayrasso/dtc
function createCreditCardPaiementID($amount_paid, $client_id, $label, $new_account = "yes", $product_id = 0, $vat_rate = 0)
{
    global $secpayconf_currency_letters;
    global $pro_mysql_pay_table;
    $hash_check_key = getRandomValue();
    $q = "INSERT INTO {$pro_mysql_pay_table} (id,id_client,label,currency,refund_amount,paiement_type,date,time,valid,new_account,shopper_ip,product_id,paiement_total,vat_rate,hash_check_key)\n\t\tVALUES ('','{$client_id}','label','{$secpayconf_currency_letters}','{$amount_paid}','online','" . date("Y-m-j") . "','" . date("H:i:s") . "','no','{$new_account}','" . $_SERVER["REMOTE_ADDR"] . "','{$product_id}','{$amount_paid}','{$vat_rate}','{$hash_check_key}');";
    $r = mysql_query($q) or die("Cannot query \"{$q}\" ! " . mysql_error() . " in file " . __FILE__ . " line " . __LINE__);
    $n = mysql_insert_id();
    return $n;
}
コード例 #10
0
function createNewMealPlan($user_id, $diet, $goal, $newMealName = '')
{
    global $wpdb;
    if ($newMealName == '') {
        $newMealName = 'Meal Plan - ' . date('d-m-Y');
    }
    $userrecipe = unserialize(get_user_meta($user_id, 'user_recipe', true));
    $args = array('post_type' => 'recipe', 'post_in' => $userrecipe, 'posts_per_page' => -1, 'caller_get_posts' => 1, 'orderby' => 'rand', 'meta_query' => array(array('key' => 'veg', 'value' => $diet, 'compare' => '=')), 'tax_query' => array('relation' => 'AND', array('taxonomy' => 'goal', 'field' => 'id', 'terms' => $goal, 'operator' => 'IN')));
    $recipeCat = false;
    //'dinner';
    if ($recipeCat) {
        $args['tax_query'][] = array('taxonomy' => 'recipe-cat', 'field' => 'slug', 'terms' => $recipeCat, 'include_children' => false, 'operator' => 'IN');
    }
    $my_query = new WP_Query($args);
    //pr($args);
    //pr($my_query->request);
    global $mealPlanColumns;
    $recipe_arr = array();
    if ($my_query->have_posts()) {
        while ($my_query->have_posts()) {
            $my_query->the_post();
            //echo get_the_ID();
            //Returns Array of Term Names for "recipe-cat"
            $tax_assigned = wp_get_post_terms(get_the_ID(), 'recipe-cat', array("fields" => "slugs"));
            foreach ($tax_assigned as $tax_assign) {
                $recipe_arr[$tax_assign][] = get_the_ID();
            }
        }
    }
    //if ($my_query)
    wp_reset_query();
    //pr($recipe_arr);
    //return;
    // Create post object
    $my_post = array('post_title' => $newMealName, 'post_content' => '', 'post_status' => 'publish', 'post_type' => 'meal', 'post_author' => $user_id);
    // Insert the post into the database
    $meal_plan_id = wp_insert_post($my_post);
    if (!is_wp_error($meal_plan_id) && $meal_plan_id > 0) {
        $meal_plan_fields = array('monday' => 'field_565d3d234344e', 'tuesday' => 'field_565d402053980', 'wednesday' => 'field_565d403a53989', 'thursday' => 'field_565d404353992', 'friday' => 'field_565d404d5399b', 'saturday' => 'field_565d405a539a4', 'sunday' => 'field_565d4068539ad');
        $allowEmptyCount = 1;
        foreach ($meal_plan_fields as $day => $meal_plan_field) {
            $allowEmptyRecipe = true;
            $emptyRecipe = 0;
            $data = $_POST['data'];
            $field_key = $meal_plan_field;
            $value = array();
            //get_field($field_key, $recipe_id);
            //$value[] = array("sub_field_1" => "Foo", "sub_field_2" => "Bar");
            $breakfast_id = getRandomValue(isset($recipe_arr['breakfast']) ? $recipe_arr['breakfast'] : array(), $allowEmptyRecipe);
            $allowEmptyRecipeTemp = canAllowRecipe($breakfast_id, $emptyRecipe, $allowEmptyCount, $allowEmptyRecipe);
            $allowEmptyRecipe = $allowEmptyRecipeTemp['allowEmptyRecipe'];
            $emptyRecipe = $allowEmptyRecipeTemp['emptyRecipe'];
            debugRecipe($breakfast_id, $emptyRecipe, $allowEmptyRecipe);
            $breakfast_snack_id = getRandomValue(isset($recipe_arr['snack']) ? $recipe_arr['snack'] : array(), $allowEmptyRecipe);
            $allowEmptyRecipeTemp = canAllowRecipe($breakfast_id, $emptyRecipe, $allowEmptyCount, $allowEmptyRecipe);
            $allowEmptyRecipe = $allowEmptyRecipeTemp['allowEmptyRecipe'];
            $emptyRecipe = $allowEmptyRecipeTemp['emptyRecipe'];
            debugRecipe($breakfast_id, $emptyRecipe, $allowEmptyRecipe);
            $lunch_id = getRandomValue(isset($recipe_arr['lunch']) ? $recipe_arr['lunch'] : array(), $allowEmptyRecipe);
            $allowEmptyRecipeTemp = canAllowRecipe($breakfast_id, $emptyRecipe, $allowEmptyCount, $allowEmptyRecipe);
            $allowEmptyRecipe = $allowEmptyRecipeTemp['allowEmptyRecipe'];
            $emptyRecipe = $allowEmptyRecipeTemp['emptyRecipe'];
            debugRecipe($breakfast_id, $emptyRecipe, $allowEmptyRecipe);
            $lunch_snack_id = getRandomValue(isset($recipe_arr['snack']) ? $recipe_arr['snack'] : array(), $allowEmptyRecipe);
            $allowEmptyRecipeTemp = canAllowRecipe($breakfast_id, $emptyRecipe, $allowEmptyCount, $allowEmptyRecipe);
            $allowEmptyRecipe = $allowEmptyRecipeTemp['allowEmptyRecipe'];
            $emptyRecipe = $allowEmptyRecipeTemp['emptyRecipe'];
            debugRecipe($breakfast_id, $emptyRecipe, $allowEmptyRecipe);
            $dinner_id = getRandomValue(isset($recipe_arr['dinner']) ? $recipe_arr['dinner'] : array(), $allowEmptyRecipe);
            $allowEmptyRecipeTemp = canAllowRecipe($breakfast_id, $emptyRecipe, $allowEmptyCount, $allowEmptyRecipe);
            $allowEmptyRecipe = $allowEmptyRecipeTemp['allowEmptyRecipe'];
            $emptyRecipe = $allowEmptyRecipeTemp['emptyRecipe'];
            debugRecipe($breakfast_id, $emptyRecipe, $allowEmptyRecipe);
            $post_workout_id = getRandomValue(isset($recipe_arr['post_workout']) ? $recipe_arr['post_workout'] : array(), $allowEmptyRecipe);
            $allowEmptyRecipeTemp = canAllowRecipe($breakfast_id, $emptyRecipe, $allowEmptyCount, $allowEmptyRecipe);
            $allowEmptyRecipe = $allowEmptyRecipeTemp['allowEmptyRecipe'];
            $emptyRecipe = $allowEmptyRecipeTemp['emptyRecipe'];
            debugRecipe($breakfast_id, $emptyRecipe, $allowEmptyRecipe);
            $value[] = array('is_fasting' => false, 'fasting_plan' => '', 'breakfast' => $breakfast_id, 'breakfast_snack' => $breakfast_snack_id, 'lunch' => $lunch_id, 'lunch_snack' => $lunch_snack_id, 'dinner' => $dinner_id, 'post_workout' => $post_workout_id);
            //pr($value);
            update_field($field_key, $value, $meal_plan_id);
        }
        return $meal_plan_id;
    }
    return 0;
}
コード例 #11
0
ファイル: fetch.php プロジェクト: jeremy-cayrasso/dtc
function randomizePassword($adm_login, $adm_input_pass)
{
    global $pro_mysql_admin_table;
    global $pro_mysql_tik_admins_table;
    global $adm_realpass;
    global $adm_pass;
    global $adm_random_pass;
    global $conf_session_expir_minute;
    global $panel_type;
    global $gettext_lang;
    $ret["err"] = 0;
    $ret["mesg"] = "No error";
    if (isset($adm_random_pass) && strlen($adm_random_pass) > 0 && isRandomNum($adm_random_pass)) {
        return $ret;
    }
    $query = "SELECT * FROM {$pro_mysql_admin_table} WHERE adm_login='******' AND (adm_pass='******' OR (pass_next_req='{$adm_pass}' AND pass_expire > '" . mktime() . "'));";
    $result = mysql_query($query);
    if (!$result) {
        $ret["err"] = 1;
        $ret["mesg"] = "Cannot execute query for password line " . __LINE__ . " file " . __FILE__ . " (error message removed for security reasons).";
        return $ret;
    }
    $num_rows = mysql_num_rows($result);
    if ($num_rows != 1) {
        $q = "SELECT * FROM {$pro_mysql_tik_admins_table} WHERE pass_next_req='{$adm_input_pass}' AND pass_expire > '" . mktime() . "';";
        $r = mysql_query($q);
        if (!$r) {
            $ret["err"] = 2;
            $ret["mesg"] = "Cannot execute query for password line " . __LINE__ . " file " . __FILE__ . " (error message removed for security reasons).";
            return $ret;
        }
        $n = mysql_num_rows($r);
        if ($n == 1) {
            $is_root_admin = "yes";
            $query = "SELECT * FROM {$pro_mysql_admin_table} WHERE adm_login='******';";
            $result = mysql_query($query);
            if (!$result) {
                $ret["err"] = 3;
                $ret["mesg"] = "Cannot execute query for password line " . __LINE__ . " file " . __FILE__ . " (error message removed for security reasons).";
                return $ret;
            }
            $num_rows = mysql_num_rows($result);
            if ($num_rows != 1) {
                $ret["mesg"] = _("Wrong user or password, or timeout expired!");
                $ret["err"] = -1;
                return $ret;
            }
        } else {
            $ret["mesg"] = _("Wrong user or password, or timeout expired!");
            $ret["err"] = -1;
            return $ret;
        }
        $is_root_admin = "yes";
    } else {
        $is_root_admin = "no";
    }
    $row = mysql_fetch_array($result);
    if (!$row) {
        $ret["err"] = 4;
        $ret["mesg"] = "Cannot fetch user line " . __LINE__ . " file " . __FILE__ . " sql said: " . mysql_error();
        return $ret;
    }
    // This stuff is rotating passwords helping NOT to save passwords on users browsers.
    $rand = getRandomValue();
    $adm_random_pass = $rand;
    $expirationTIME = mktime() + 60 * $conf_session_expir_minute;
    if ($panel_type == "admin" && $is_root_admin == "yes") {
        $q = "UPDATE {$pro_mysql_tik_admins_table} SET pass_next_req='{$rand}', pass_expire='{$expirationTIME}' WHERE pseudo='" . $_SERVER["PHP_AUTH_USER"] . "';";
        $r = mysql_query($q);
        if (!$r) {
            $ret["err"] = 5;
            $ret["mesg"] = "Cannot execute query \"{$q}\" !";
            return $ret;
        }
    } else {
        $q = "UPDATE {$pro_mysql_admin_table} SET pass_next_req='{$rand}', pass_expire='{$expirationTIME}' WHERE adm_login='******'";
        $r = mysql_query($q);
        if (!$r) {
            $ret["err"] = 6;
            $ret["mesg"] = "Cannot execute query \"{$q}\" !";
            return $ret;
        }
    }
    // Save the last used language, so we know for future email sendings what to use.
    if (isset($gettext_lang) && $panel_type == "client") {
        $q = "UPDATE {$pro_mysql_admin_table} SET last_used_lang='{$gettext_lang}' WHERE adm_login='******';";
        $r = mysql_query($q);
    }
    $adm_pass = $rand;
    $adm_realpass = $row["adm_pass"];
}
コード例 #12
0
ファイル: getDomain.php プロジェクト: tomgsmith99/j-rug
function getDomain()
{
    global $domainList;
    return getRandomValue($domainList, max(array_keys($domainList)));
}
コード例 #13
0
<?php

require_once 'bootstrap.php';
/**
 * @var $vulcanoXsdToXmlGenerator VulcanoXsdToXmlGenerator
 */
$vulcanoXsdToXmlGenerator->appendNodeData('atom', array('name' => getRandomValue()));
$vulcanoXsdToXmlGenerator->appendNodeData('donkey', array('name' => getRandomValue(), 'birthday' => getRandomValue()));
$vulcanoXsdToXmlGenerator->appendNodeData('cow', array('name' => getRandomValue(), 'birthday' => getRandomValue()));
$vulcanoXsdToXmlGenerator->appendNodeData('pic', array('name' => getRandomValue(), 'birthday' => getRandomValue()));
$vulcanoXsdToXmlGenerator->appendNodeData('corn', array('number' => getRandomValue()));
$vulcanoXsdToXmlGenerator->appendNodeData('farm', array('name' => getRandomValue(), 'size' => getRandomValue()));
$vulcanoXsdToXmlGenerator->appendNodeData('created', array('date' => getRandomValue()));
$vulcanoXsdToXmlGenerator->appendNodeData('tractor', array('name' => getRandomValue()));
echo $vulcanoXsdToXmlGenerator->generate();