Ejemplo n.º 1
0
 /** 
  * Test activation routine.
  */
 public function test_activate()
 {
     // Setup
     \WP_Mock::wpFunction('flush_rewrite_rules', array('times' => 1));
     // Act
     activate();
     // Verify
     $this->assertConditionsMet();
 }
Ejemplo n.º 2
0
                 mysql_query("UPDATE `main_loop_status` SET `field_data` = '3' WHERE `main_loop_status`.`field_name` = 'foundation_heartbeat_active' LIMIT 1");
                 mysql_query("UPDATE `main_loop_status` SET `field_data` = '3' WHERE `main_loop_status`.`field_name` = 'generation_heartbeat_active' LIMIT 1");
                 mysql_query("UPDATE `main_loop_status` SET `field_data` = '3' WHERE `main_loop_status`.`field_name` = 'genpeer_heartbeat_active' LIMIT 1");
                 mysql_query("UPDATE `main_loop_status` SET `field_data` = '3' WHERE `main_loop_status`.`field_name` = 'peerlist_heartbeat_active' LIMIT 1");
                 mysql_query("UPDATE `main_loop_status` SET `field_data` = '3' WHERE `main_loop_status`.`field_name` = 'queueclerk_heartbeat_active' LIMIT 1");
                 mysql_query("UPDATE `main_loop_status` SET `field_data` = '3' WHERE `main_loop_status`.`field_name` = 'transclerk_heartbeat_active' LIMIT 1");
                 mysql_query("UPDATE `main_loop_status` SET `field_data` = '3' WHERE `main_loop_status`.`field_name` = 'treasurer_heartbeat_active' LIMIT 1");
                 // Stop all other script activity
                 activate(FOUNDATION_DISABLED, 0);
                 activate(GENERATION_DISABLED, 0);
                 activate(GENPEER_DISABLED, 0);
                 activate(PEERLIST_DISABLED, 0);
                 activate(QUEUECLERK_DISABLED, 0);
                 activate(TRANSCLERK_DISABLED, 0);
                 activate(TREASURER_DISABLED, 0);
                 activate(BALANCE_DISABLED, 0);
                 echo 1;
             } else {
                 echo 0;
             }
         }
     } else {
         // Already Stopped
         echo 2;
     }
 }
 // End Stop Main Timekoin
 if ($active == 3) {
     write_log("Watchdog Sent START Command from IP: " . $_SERVER['REMOTE_ADDR'], "AP");
     // Check last heartbeat and make sure it was more than X seconds ago
     $watchdog_heartbeat_active = mysql_result(mysql_query("SELECT field_data FROM `main_loop_status` WHERE `field_name` = 'watchdog_heartbeat_active' LIMIT 1"), 0, 0);
Ejemplo n.º 3
0
      <div>
          <ul class="nav navbar-nav navbar-right">
            <li <?php 
    echo activate("stream");
    ?>
><a href="stream.php">stream <span class="glyphicon glyphicon-circle-arrow-down"></a></li>
            <li <?php 
    echo activate("profile");
    ?>
><a href="profile.php">profile <span class="glyphicon glyphicon-user"></span></a></li>
            <li <?php 
    echo activate("notifications");
    ?>
><a href="notifications.php">notifications <span class="glyphicon glyphicon-globe"></a></li> 
            <li <?php 
    echo activate("logout");
    ?>
><a href="logout.php">log out <span class="glyphicon glyphicon-log-out"></a></li> 
          </ul>
      </div>
      <?php 
} else {
    if ($_SERVER["PHP_SELF"] != "/login.php" && $_SERVER["PHP_SELF"] != "/register.php") {
        ?>
      <form class="navbar-form navbar-right" action="login.php" method="post">
        <div class="form-group">
          <input type="text" placeholder="Email" name="email" class="form-control">
        </div>
        <div class="form-group">
          <input type="password" placeholder="Password" name="password" class="form-control">
        </div>
Ejemplo n.º 4
0
        break;
    case "pass_lost":
        pass_lost();
        break;
    case "new_user":
        new_user();
        break;
    case "my_headlines":
        if (is_user($user)) {
            if (!empty($url)) {
                my_headlines($hid, $url);
            } else {
                die;
            }
        } else {
            Header("Location: modules.php?name={$module_name}");
        }
        break;
    case "gfx":
        gfx($random_num);
        break;
    case "activate":
        activate($username, $check_num);
        break;
    case "CoolSize":
        CoolSize($size);
        break;
    default:
        main($user);
        break;
}
Ejemplo n.º 5
0
<?php

/*
 * Created on 17-okt-2011
 * author Paul Wolbers
 */
$current_path = dirname(realpath(__FILE__));
require_once '../include/default.inc.php';
if (isset($_GET['action'])) {
    switch ($_GET['action']) {
        case 'reset':
            forgottenPassword();
            break;
        case 'activate':
            activate();
            break;
        case 'change_password':
            changePassword();
            break;
    }
} else {
    $letters = 'ABCDEFGHKLMNPRSTUVWYZ';
    $_SESSION['cptch'] = rand(10, 99) . substr($letters, rand(1, 20), 1) . substr($letters, rand(1, 20), 1) . rand(10, 99);
    $_SESSION['c_s_id'] = md5($_SESSION['cptch']);
    $obj_smarty->display(FULLCAL_DIR . '/forgotten-password/index.tpl');
    //header('location:'.FULLCAL_DIR.'/get-the-app-and-register');
    exit;
}
function forgottenPassword()
{
    global $error;
Ejemplo n.º 6
0
             }
             // Transaction hash
             $hash = hash('sha256', $hash);
             $sql = "INSERT INTO `transaction_history` (`timestamp` ,`public_key_from` ,`public_key_to` ,`crypt_data1` ,`crypt_data2` ,`crypt_data3` ,`hash` ,`attribute`)\n\t\t\t\tVALUES ('{$second_generation_cycle}', '{$generation_arbitrary}', '{$generation_arbitrary}', '{$generation_arbitrary}', '{$generation_arbitrary}', '{$generation_arbitrary}', '{$hash}', 'H')";
             mysql_query($sql);
             $current_generation_block--;
             $cycles++;
         }
         $current_generation_block++;
         $second_generation_cycle = transaction_cycle(0 - $current_generation_block + 1);
         $hash_check = mysql_result(mysql_query("SELECT hash FROM `transaction_history` WHERE `timestamp` = '{$second_generation_cycle}' AND `attribute` = 'H' LIMIT 1"), 0, 0);
         // Now let's check the results to make sure they match what should be expected
         if ($hash_check == SHA256TEST) {
             // Passed final hash checking.
             // Unlock Treasurer script to allow live processing
             activate(TREASURER, 1);
             // Start a block rebuild from this since a new database is going to be far
             // behind the history of the other active peers
             mysql_query("UPDATE `main_loop_status` SET `field_data` = '3' WHERE `main_loop_status`.`field_name` = 'block_check_start' LIMIT 1");
             mysql_query($sql);
         } else {
             write_log("Server Failed Initial Encryption Generation and Verification Testing", "TC");
         }
     }
 }
 // End database preparation and hash testing
 //***********************************************************************************
 // Check the transaction hash generation
 if ($sql_num_results > 3) {
     //***********************************************************************************
     // Update transaction history hash
Ejemplo n.º 7
0
    include 'includes/menu.php';
    if (isset($_REQUEST['success']) && empty($_REQUEST['success'])) {
        ?>
			<div class="user_entry">
				<h2>Thanks, We've activated your account and you can now login!</h2>
				<p><a href="index.php">Click here</a> to log in.</p>
			</div>
			<?php 
    } else {
        if (isset($_REQUEST['email'], $_REQUEST['email_code'])) {
            $email = trim($_REQUEST['email']);
            $email_code = trim($_REQUEST['email_code']);
            if (!email_exists) {
                $errors[] = 'Oops, something went wrong and we couldn\'t find that email address!.';
            } else {
                if (!activate($email, $email_code)) {
                    $errors[] = 'Activation Failed!!<br />We could not activate your account as we are facing problems.';
                }
            }
            if (!empty($errors)) {
                ?>
				<div class="user_entry">
				<h2>Oops..</h2>
				<?php 
                echo output_errors();
            } else {
                header("Location: activate.php?success");
                exit;
            }
            ?>
				</div>
Ejemplo n.º 8
0
}
switch ($task) {
    case 'lostPassword':
        lostPassForm($option);
        break;
    case 'sendNewPass':
        sendNewPass($option);
        break;
    case 'register':
        registerForm($option, $mosConfig_useractivation);
        break;
    case 'saveRegistration':
        saveRegistration();
        break;
    case 'activate':
        activate($option);
        break;
}
function lostPassForm($option)
{
    global $mainframe;
    $mainframe->SetPageTitle(_PROMPT_PASSWORD);
    HTML_registration::lostPassForm($option);
}
function sendNewPass($option)
{
    global $database;
    global $mosConfig_live_site, $mosConfig_sitename;
    global $mosConfig_mailfrom, $mosConfig_fromname;
    // simple spoof check security
    josSpoofCheck();
Ejemplo n.º 9
0
 function activer()
 {
     lcm_log("use of deprecated function: activer, use activate instead");
     return activate();
 }
Ejemplo n.º 10
0
                                </li>

                            </ul>

                        </li>

                    <?php 
    }
    ?>

                <?php 
}
?>

                <li class="<?php 
echo activate(2, 'calendar');
?>
 treeview">
                    <a href="<?php 
echo base_url() . 'administrator/calendar';
?>
"><i class='fa fa-calendar'></i> <span>Calendar</span></a>
                </li>

<!--                <li class="--><?php 
//echo activate(2, 'invoice');
?>
<!-- treeview">-->
<!--                    <a href="--><?php 
//echo base_url() . 'administrator/invoice';
?>
Ejemplo n.º 11
0
//    You should have received a copy of the GNU Affero General Public License
//    along with this program.  If not, see http://www.gnu.org/licenses/
define('ACTIVATION_CODE_WRONG', 1);
define('RECORD_FOR_OTHER_APP', 2);
define('ACTIVATION_RECORD_NOT_FOUND', 3);
$headers = parseRequestHeaders();
$action = $headers['Action'];
switch ($action) {
    case "checkresponding":
        checkresponding();
        break;
    case "checkuidpresent":
        checkuidpresent($headers);
        break;
    case "activate":
        activate($headers);
        break;
    case "update":
        update($headers);
        break;
    case "event":
        event($headers);
        break;
    case "ensureactivationrecord":
        ensureactivation($headers);
        break;
}
// request to check if the backend is responding
function checkresponding()
{
    header('success: true');
Ejemplo n.º 12
0
function alterReason($memNum, $reasonCode, $status = False)
{
    global $sql;
    $username = checkLogin();
    $uid = getUID($username);
    $model = new CustomerAccountSuspensionsModel($sql);
    $model->card_no($memNum);
    $upQ = $sql->prepare("UPDATE suspensions SET reasoncode=? WHERE cardno=?");
    $upR = $sql->execute($upQ, array($reasonCode, $memNum));
    if ($reasonCode == 0) {
        activate($memNum);
    } else {
        $now = date("Y-m-d h:i:s");
        $m_status = 0;
        $insQ = $sql->prepare("INSERT INTO suspension_history (username, postdate, post, cardno, reasoncode) \n                                VALUES (?,?,'',?,?)");
        $insR = $sql->execute($insQ, array($username, $now, $memNum, $reasonCode));
        if ($status) {
            $prep = $sql->prepare("UPDATE custdata SET type=? WHERE cardno=?");
            $sql->execute($prep, array($status, $memNum));
            if ($status == "TERM") {
                $custP = $sql->prepare("UPDATE suspensions SET type='T' WHERE cardno=?");
                $sql->execute($custP, array($memNum));
                $m_status = 2;
            } else {
                $custP = $sql->prepare("UPDATE suspensions SET type='I' WHERE cardno=?");
                $sql->execute($custP, array($memNum));
                $m_status = 1;
            }
        }
        $changed = false;
        $model->active(1);
        // find most recent active record
        $current = $model->find('tdate', true);
        foreach ($current as $obj) {
            if ($obj->reasonCode() != $reasonCode || $obj->suspensionTypeID() != $m_status) {
                $changed = true;
            }
            $model->savedType($obj->savedType());
            $model->savedMemType($obj->savedMemType());
            $model->savedDiscount($obj->savedDiscount());
            $model->savedChargeLimit($obj->savedChargeLimit());
            $model->savedMailFlag($obj->savedMailFlag());
            // copy "saved" values from current active
            // suspension record. should only be one
            break;
        }
        // only add a record if something changed.
        // count($current) of zero means there is no
        // record. once the migration to the new data
        // structure is complete, that check won't
        // be necessary
        if ($changed || count($current) == 0) {
            $model->reasonCode($reasonCode);
            $model->tdate($now);
            $model->username($username);
            $model->suspensionTypeID($m_status);
            $new_id = $model->save();
            // only most recent should be active
            $model->reset();
            $model->card_no($memNum);
            $model->active(1);
            foreach ($model->find() as $obj) {
                if ($obj->customerAccountSuspensionID() != $new_id) {
                    $obj->active(0);
                    $obj->save();
                }
            }
        }
    }
}
Ejemplo n.º 13
0
if (!$user_cfg['allowuserreg']) {
    cpg_error(_ACTDISABLED);
}
if (Security::check_post()) {
    if (isset($_POST['op']) && $_POST['op'] == 'finish') {
        $pagetitle = _ACCOUNTCREATED;
        require_once 'header.php';
        register_finish();
    } else {
        $pagetitle = _USERFINALSTEP;
        require_once 'header.php';
        register_check();
    }
} else {
    if (isset($_GET['activate'])) {
        activate(intval($_GET['activate']), Fix_Quotes($_GET['check_num']));
    } else {
        if (!isset($_GET['agreed']) && !isset($_POST['agreed']) && $user_cfg['show_registermsg']) {
            $pagetitle = _MA_REGISTRATION;
            require_once 'header.php';
            OpenTable();
            echo '<table width="80%" cellspacing="2" cellpadding="2" border="0" style="margin:auto;">
	  <tr>
		<td><span class="genmed"><br />' . $user_cfg['registermsg'] . '<br /><br />' . _BOUNDREGISTRATION . '<br /><br /></span><div align="center">
		  <a href="' . URL::index("&amp;file=register&amp;agreed=1") . '" class="genmed">' . _MA_AGREE_OVER_13 . '</a><br /><br />
		  <a href="' . URL::index("&amp;file=register&amp;agreed=1&amp;coppa=1") . '" class="genmed">' . _MA_AGREE_UNDER_13 . '</a><br /><br />
		  <a href="' . $mainindex . '" class="genmed">' . _MA_DO_NOT_AGREE . '</a></div><br /></td>
	  </tr>
	</table>';
            CloseTable();
        } else {
Ejemplo n.º 14
0
                 mysql_query("UPDATE `main_loop_status` SET `field_data` = '3' WHERE `main_loop_status`.`field_name` = 'peerlist_heartbeat_active' LIMIT 1");
                 mysql_query("UPDATE `main_loop_status` SET `field_data` = '3' WHERE `main_loop_status`.`field_name` = 'queueclerk_heartbeat_active' LIMIT 1");
                 mysql_query("UPDATE `main_loop_status` SET `field_data` = '3' WHERE `main_loop_status`.`field_name` = 'transclerk_heartbeat_active' LIMIT 1");
                 mysql_query("UPDATE `main_loop_status` SET `field_data` = '3' WHERE `main_loop_status`.`field_name` = 'treasurer_heartbeat_active' LIMIT 1");
                 // Stop all other script activity
                 activate(TIMEKOINSYSTEM, 0);
                 header("Location: index.php?menu=home");
                 exit;
             }
         }
     } else {
         $server_code = '<font color="red"><strong>Timekoin was already Stopped...</strong></font>';
         // Clear transaction queue to avoid unnecessary peer confusion
         mysql_query("TRUNCATE TABLE `transaction_queue`");
         // Stop all other script activity
         activate(TIMEKOINSYSTEM, 0);
     }
 }
 if ($_GET["code"] == "1") {
     $server_code = '<font color="green"><strong>Timekoin Process Started...</strong></font>';
 }
 if ($_GET["code"] == "99") {
     $server_code = '<font color="blue"><strong>Timekoin Process Already Active...</strong></font>';
 }
 if ($_GET["code"] == "2") {
     $server_code = '<font color="green"><strong>Watchdog Process Started...</strong></font>';
 }
 if ($_GET["code"] == "89") {
     $server_code = '<font color="blue"><strong>Watchdog Process Already Active...</strong></font>';
 }
 $body_string = system_screen();
Ejemplo n.º 15
0
<?php

include 'include.php';
isAllowed();
if (!isset($_GET['id'])) {
    setFlash("action impossible.", "danger");
    redirect("accueil.php");
    die;
}
$asked = $_SESSION['profil']['id'];
$user = $_GET['id'];
$friendship = activate($user, $asked);
if ($friendship == 400) {
    setFlash("action impossible.", "danger");
    redirect('acceuil.php');
} elseif ($friendship == 500) {
    setFlash('Nos services sont en panne, nous faisons notre possible pour régler le problème.', 'danger');
    redirect('serveur_down.php');
} elseif ($friendship == 200) {
    setFlash("Cette personne a bien été ajoutée votre liste d'amis");
    redirect('invitations.php');
} else {
    setFlash('Nos services sont en panne, nous faisons notre possible pour régler le problème.', 'danger');
    redirect('serveur_down.php');
}
Ejemplo n.º 16
0
<?php

include 'core/init.php';
logged_in_redirect();
if (isset($_GET['success']) === true && empty($_GET['success']) === true) {
    ?>
		<h2 class="activated_scsfly">Contul tau a fost activat cu succes. Te rugam sa te <a href="login.php">loghezi</a></h2>
	<?php 
} else {
    if (isset($_GET['email'], $_GET['email_code']) === true) {
        $email = trim($_GET['email']);
        $email_code = trim($_GET['email_code']);
        if (email_exists($email) === false) {
            $errors[] = 'Ne pare rau, nu am reusit sa gasim aceasta adresa de email';
        } else {
            if (activate($email, $email_code) === false) {
                $errors[] = 'Din pacate nu am reusit sa va activam contul';
            }
        }
        if (empty($errors) === false) {
            echo output_errors($errors);
        } else {
            header('Location: activate.php?success');
            exit;
        }
    } else {
        header('Location: index.php');
        exit;
    }
}
?>
Ejemplo n.º 17
0
function manage_surveys()
{
    global $table_prefix, $wpdb;
    $survey_table = $table_prefix . "surveys";
    if (isset($_REQUEST["wpsurv_submit"])) {
        require_once 'functions.php';
        if ($_POST["wpsurv_submit"] == __('Edit', 'wp-surveys') || $_POST["wpsurv_submit"] == __('Cancel', 'wp-surveys') || $_POST["wpsurv_submit"] == __('Back to Edit Survey', 'wp-surveys')) {
            edit($_POST['survey_id']);
        } elseif ($_POST["wpsurv_submit"] == __('Update', 'wp-surveys')) {
            update($_POST['survey_id']);
        } elseif ($_POST["wpsurv_submit"] == __('Update Options', 'wp-surveys')) {
            update_options($_POST['survey_id'], $_POST['question_id']);
        } elseif ($_POST["wpsurv_submit"] == __('Activate', 'wp-surveys') || $_POST["wpsurv_submit"] == __('Make Active', 'wp-surveys')) {
            activate($_POST['survey_id']);
        } elseif ($_POST["wpsurv_submit"] == __('Retire', 'wp-surveys')) {
            retire($_POST['survey_id']);
        } elseif ($_POST["wpsurv_submit"] == __('Update Leaderboard', 'wp-surveys')) {
            recach_utility($_POST['survey_id']);
        } elseif ($_POST["wpsurv_submit"] == __('Edit Options', 'wp-surveys') || $_POST["wpsurv_submit"] == __('Add Some Options', 'wp-surveys') || $_POST["wpsurv_submit"] == __('Edit or Add more Options', 'wp-surveys')) {
            edit_options($_POST['survey_id'], $_POST['question_id']);
        } elseif ($_POST["wpsurv_submit"] == __('Add More Questions', 'wp-surveys') || $_POST["wpsurv_submit"] == __('Add Some Questions', 'wp-surveys')) {
            add_question($_POST['survey_id']);
        } elseif ($_POST["wpsurv_submit"] == __('Step 2', 'wp-surveys')) {
            step2($_POST['survey_id']);
        } elseif ($_POST["wpsurv_submit"] == __('Create Question', 'wp-surveys')) {
            create_quest($_POST['survey_id']);
        } elseif ($_POST["wpsurv_submit"] == __('Change Survey', 'wp-surveys') || $_POST["wpsurv_submit"] == __('Add Survey', 'wp-surveys')) {
            survey($_POST['survey_id']);
        } elseif ($_POST["wpsurv_submit"] == __('Add This Survey', 'wp-surveys')) {
            add_survey($_POST['survey_id']);
        } elseif ($_POST["wpsurv_submit"] == __('View Survey Results', 'wp-surveys')) {
            results($_POST['survey_id']);
        }
        //elseif($_POST["wpsurv_submit"] == __('View Survey Results in CSV File', 'wp-surveys'))
        //results_CSV($_POST['survey_id']);
        //elseif($_POST["wpsurv_submit"] == __('Delete File', 'wp-surveys'))
        //delete_file($_POST['survey_id']);
    } else {
        $current_plugins = get_option('active_plugins');
        if (file_exists(ABSPATH . PLUGINDIR . '/polyglot.php') && in_array('polyglot.php', $current_plugins)) {
            $polyglot = true;
        }
        echo '<div class="wrap">';
        $open_surveys = $wpdb->get_results("SELECT * FROM `" . $survey_table . "` WHERE `survey_open`='1' LIMIT 1;", ARRAY_A);
        echo '<h2>' . __('Survey Management', 'wp-surveys') . '</h2><h3><u>' . __('Active Survey', 'wp-surveys') . '</u>:</h3>';
        if ($open_surveys) {
            echo '<table class="widefat" width="100%" cellpadding="4" cellspacing="4">';
            echo '<tr><th align="left">' . __('Title', 'wp-surveys') . '</th><th align="left">' . __('Description', 'wp-surveys') . '</th><th></th><th></th><th></th></tr>';
            foreach ($open_surveys as $survey) {
                echo '<tr class="alternate">';
                if ($polyglot) {
                    echo '<td><b>' . polyglot_filter(stripcslashes($survey['survey_name'])) . '</b></td><td>' . polyglot_filter(stripcslashes($survey['survey_describe'])) . '</td>';
                } elseif (!$polyglot) {
                    echo '<td><b>' . stripcslashes($survey['survey_name']) . '</b></td><td>' . stripcslashes($survey['survey_describe']) . '</td>';
                }
                echo '<td class="submit" align="center"><form method="post" action=""><input type="hidden" name="survey_id" value="' . $survey['survey_id'] . '" />';
                echo '<input type="submit" name="wpsurv_submit" value="' . __('Edit', 'wp-surveys') . '" /></form></td>';
                echo '<td class="submit" align="center"><form method="post" action=""><input type="hidden" name="survey_id" value="' . $survey['survey_id'] . '" />';
                echo '<input type="submit" name="wpsurv_submit" value="' . __('Retire', 'wp-surveys') . '" /></form></td>';
                echo '<td class="submit" align="center"><form method="post" action=""><input type="hidden" name="survey_id" value="' . $survey['survey_id'] . '" />';
                echo '<input type="submit" name="wpsurv_submit" value="' . __('View Survey Results', 'wp-surveys') . '" /></form></td>';
                //echo '<td align="center"><form method="post" action=""><input type="hidden" name="survey_id" value="'.$survey['survey_id'].'" />';
                //echo '<input type="submit" name="wpsurv_submit" value="'.__('View Survey Results in CSV File', 'wp-surveys').'" /></form></td>';
                echo '</tr>';
            }
            echo '</table>';
            $next = ++$survey['survey_id'];
            echo '<br /><form method="post" action=""><input type="hidden" name="survey_id" value="' . $next . '" /><input class="button" type="submit" name="wpsurv_submit" value="' . __('Change Survey', 'wp-surveys') . '" title="' . __('Current Survey will be saved as Retired', 'wp-surveys') . '" /></form>';
        } else {
            echo __('There are no open tournaments or contests.', 'wp-surveys') . '.';
            //$last = $wpdb->get_var("SELECT COUNT(`survey_id`) FROM `".$survey_table."`;");
            $last = $wpdb->get_var("SELECT `survey_id` FROM `" . $survey_table . "` ORDER BY `survey_id` DESC LIMIT 1;");
            $next = ++$last;
            echo '<br /><br /><form method="post" action=""><input type="hidden" name="survey_id" value="' . $next . '" /><input class="button" type="submit" name="wpsurv_submit" value="' . __('Add Survey', 'wp-surveys') . '" /></form>';
        }
        $closed_surveys = $wpdb->get_results("SELECT * FROM `" . $survey_table . "` WHERE `survey_open`='0';", ARRAY_A);
        echo '<h3><u>' . __('Retired Surveys', 'wp-surveys') . '</u>:</h3>';
        if ($closed_surveys) {
            echo '<table class="widefat" width="100%" cellpadding="4" cellspacing="4">';
            echo '<tr><th align="left">' . __('Title', 'wp-surveys') . '</th><th align="left">' . __('Description', 'wp-surveys') . '</th><th></th><th></th><th></th></tr>';
            foreach ($closed_surveys as $survey) {
                echo '<tr class="alternate">';
                if ($polyglot) {
                    echo '<td><b>' . polyglot_filter(stripcslashes($survey['survey_name'])) . '</b></td><td>' . polyglot_filter(stripcslashes($survey['survey_describe'])) . '</td>';
                } elseif (!$polyglot) {
                    echo '<td><b>' . stripcslashes($survey['survey_name']) . '</b></td><td>' . stripcslashes($survey['survey_describe']) . '</td>';
                }
                echo '<td class="submit" align="center"><form method="post" action=""><input type="hidden" name="survey_id" value="' . $survey['survey_id'] . '" />';
                echo '<input type="submit" name="wpsurv_submit" value="' . __('Edit', 'wp-surveys') . '" /></form></td>';
                echo '<td class="submit" align="center"><form method="post" action=""><input type="hidden" name="survey_id" value="' . $survey['survey_id'] . '" />';
                echo '<input type="submit" name="wpsurv_submit" value="' . __('Make Active', 'wp-surveys') . '" /></form></td>';
                echo '<td class="submit" align="center"><form method="post" action=""><input type="hidden" name="survey_id" value="' . $survey['survey_id'] . '" />';
                echo '<input type="submit" name="wpsurv_submit" value="' . __('View Survey Results', 'wp-surveys') . '" /></form></td>';
                //echo '<td align="center"><form method="post" action=""><input type="hidden" name="survey_id" value="'.$survey['survey_id'].'" />';
                //echo '<input type="submit" name="wpsurv_submit" value="'.__('View Survey Results in CSV File', 'wp-surveys').'" /></form></td>';
                echo '</tr>';
            }
            echo '</table>';
        } else {
            echo __('There are no retired surveys', 'wp-surveys') . '.';
        }
        echo '</div>';
    }
}
Ejemplo n.º 18
0
function proc_new_account()
{
    global $standard_scan_radius;
    $name = trim($_POST["username"]);
    $imperium = trim($_POST["imperium"]);
    $email = trim($_POST["email"]);
    $password = trim($_POST["password"]);
    $password2 = trim($_POST["password2"]);
    $error = "";
    if ($name == "") {
        $error = $error . "No name selected!<br>";
    }
    $sth = mysql_query("select * from users where name='{$name}'");
    if (mysql_num_rows($sth) > 0) {
        $error = $error . "Name already selected!<br>";
    }
    if ($imperium == "") {
        $error = $error . "No empire selected!<br>";
    }
    $sth = mysql_query("select imperium from users where imperium='{$imperium}'");
    if (!$sth) {
        show_error("Database failure!");
        return 0;
    }
    if (mysql_num_rows($sth) > 0) {
        $error = $error . "empire already selected!<br>";
    }
    if (!mail_check($email)) {
        $error = $error . "You must enter a valid email!<br>";
    }
    $sth = mysql_query("select email from users where email='{$email}'");
    if (mysql_num_rows($sth) > 0) {
        $error = $error . "Email already exists<br>";
    }
    if ($password != $password2) {
        $error = $error . "Passwords don't match!<br>";
    }
    if (strlen($password) < 4) {
        $error = $error . "Your Password must contain at least 4 characters!";
    }
    if (strlen($error) == 0) {
        $sth = mysql_query("insert into users (name,imperium,email,password) values ('{$name}','{$imperium}','{$email}','" . crypt($password) . "')");
        if (!$sth) {
            show_error("Database Failure!");
            return 0;
        }
        $uid = mysql_insert_id();
        $sth = mysql_query("insert into ressources (metal,energy,mopgas,erkunum,gortium,susebloom,colonists,money,uid) values ('1000','1000','0','0','0','0','5','1000000','{$uid}')");
        if (!$sth) {
            show_error("Database Failure!");
            return 0;
        }
        $start = startplanet();
        $sth = mysql_query("update planets set uid='{$uid}',population='1000000' where id='" . $start . "'");
        if (!$sth) {
            show_error("Database Failure!");
            return 0;
        }
        $sth = mysql_query("insert into popgain set pid=" . $start);
        if (!$sth) {
            show_error("ERR::SET POPGAIN");
            return 0;
        }
        $sth = mysql_query("update users set homeworld={$start} where id='" . $uid . "'");
        if (!$sth) {
            show_error("Database Failure!");
            return 0;
        }
        $sth = mysql_query("select p.sid,s.cid from planets p,systems s where p.id=" . $start . " and p.sid=s.id");
        if (!$sth) {
            show_error("ERR::GET SID");
            return 0;
        }
        list($sid, $cid) = mysql_fetch_row($sth);
        $sth1 = mysql_query("replace into __scanranges_" . $cid . " (sid,uid,type,range,last_update) values ('" . $sid . "','" . $uid . "','0','" . $standard_scan_radius . "','" . $time . "')");
        mt_srand((double) microtime() * 1000000);
        $act_code = mt_rand(100000, 99999999);
        $sth = mysql_query("insert into activationcodes (code,uid) values ('" . $act_code . "','{$uid}')");
        // WIIIIIICHTIG!
        $sth = mysql_query("insert into research (uid,t_id) values ('{$uid}','0')");
        $sth = mysql_query("insert into research (uid,t_id) values ('{$uid}','1')");
        $sth = mysql_query("update users set skin=1 where id={$uid}");
        $the_mail = "Welcome to the Pre-Beta-Round Regent!\n\nYour Login: {$name}\nYour Empire: {$imperium}\nYour Pass: {$password}\nYour Activationcode: {$act_code}\n\nTo activate your account click on the following link:\n\nhttp://www.spaceregents.de/spaceregents/login.php?act=activate\n\nPlease not that this is a TEST(!)-Round. That means that SpaceRegents\nmay still be full of bugs and unimplemented features. As a tester you\nare supposed to report any bugs you encounter and report them in\nour forums. You can and (maybe should ;) ) try to hack our scripts\nbut you should (again) report any successfull hacks in the forum.\n\nLast but not least: Good luck and have fun ;)\n\nThe SpaceRegents Team\n";
        mail($email, "Your Spaceregents Activation Code", $the_mail, "From: webmaster@spaceregents.de\nReply-To: webmaster@spaceregents.de\nX-Mailer: PHP/" . phpversion());
        ticker($uid, "*lmail.php*Hi and welcome to SpaceRegents. A mail with quickstart instructions is in your Inbox. Click here to see your Inbox.", "w");
        $quickstart = "Welcome to Spaceregents, the ultimate Space Strategy!\n\nThis is a short quickstart and should give you the\nfirst hints on how to play SpaceRegents.\n\nOn the left you'll find your buddy list and the\nNavgationpanel.\n\nNavigationbuttons (in top-down order):\n\nOverview (the page you saw when logging in)\nCommunication (Communiction, Alliance menus.)\nRanking\nPlanets and Production (Planets, Build menu)\nFleet (Fleetmanagement)\nMap (The SpaceRegents starmap)\nResearch\nCovertops (Espionage and sabotage your enemies)\nTrade (Trading of ressources)\n\nFurthermore you'll see the Preferences and Logout\nbuttons in the lower left corner.\n\nFirst you should start your research and build\nsomething on a planet (Metal mine is recommended).\nThe time is estimated in weeks. 1 week in\nSpaceRegents is equal to 1 hour in reality.\nAfter that you should have a look at the Map (make\nsure you have a supported SVG Viewer on your\nsystem) to get an idea where you are located and\nwho is in your neighbourhood. If you want you can\nexamine the alliances which exist in Spaceregents\nso far. As a neutral player you can't be attacked\nbut you have several limitations in the game. If\nyou join an alliance you don't have these\nlimitations but you can be attacked. So you are\nsafe for now but should consider to join/create an\nalliance soon. It may be a good idea to contact\nyour direct neighbours as well.\n\nThis should have given you a first glance at\nSpaceRegents. More about the features of\nSpaceregents is explained in the manual. If you\nneed help feel free to join the forum and post\nyour questions there.\n\nGood luck and have fun!\n\nThe Spaceregents Team.";
        mail_to_uid($uid, "Quickstart", $quickstart);
        // runelord: options setzen
        $sth = mysql_query("insert into options (uid, map_size) values(" . $uid . ",1)");
        if (!$sth) {
            show_error("Database Failure!");
            return 0;
        }
        // geben wir noch jedem ein scout :)
        // nächste freie fleet_id finden
        $sth = mysql_query("select if(max(fid) is NULL,1,max(fid)+1) from fleet_info");
        if (!$sth) {
            show_error("Database Failure!");
            return 0;
        }
        list($next_fid) = mysql_fetch_row($sth);
        // eintrag in fleet_info
        $sth = mysql_query("insert into fleet_info (fid, pid, sid, name, uid) values('{$next_fid}','{$start}','{$sid}','Explorer','{$uid}')");
        if (!$sth) {
            show_error("Database Failure! 2x");
            return 0;
        }
        $sth = mysql_query("insert into fleet values (2,1,0,'{$next_fid}')");
        if (!$sth) {
            show_error("Database Failure! 3x");
            return 0;
        }
        $sth = mysql_query("insert into income_stats set uid=" . $uid);
        if (!$sth) {
            show_error("ERR::INCOME STATS");
            return 0;
        }
        activate("new_account");
    } else {
        new_account($error);
    }
}
Ejemplo n.º 19
0
<?php

include './v1/libs/helper.php';
$activation_code = $_GET['activation_code'];
if (isset($activation_code)) {
    activate($activation_code);
}
Ejemplo n.º 20
0
<ul class="nav navbar-nav nav-pills">
  <li <?php 
activate("#");
?>
 ><a href={{ url('http://p1.joyabia.co') }}>P1-About Me</a></li> 
  <li <?php 
activate("#");
?>
> <a href={{ url('http://p2.joyabia.co') }}>P2-XKCD</a></li>
  <li <?php 
activate("/");
?>
><a href="/">P3- Developer's Best Friend</a></li>
  <li <?php 
activate("#");
?>
><a href="#">P4 - Seed Management System</a></li>
</ul>
</div>
</nav>


<div class="row" id="intro_row">
<h1> The Developer's Best Friend</h1>
<p >Are you building an application and need seed data for user accounts and text?  Your best friend is here to hold your hand. Enter the number of paragraphs or users you want to create, select extra features and submit. Va! Va! Voom! the data you need right here on your screen.</p>
</div>


	
Ejemplo n.º 21
0
        } else {
            $fields = array('ACTIVE' => 'Y', 'USER_ID' => $userId, 'SECRET' => $_POST['secret'], 'TYPE' => $_POST['type'], 'SYNC1' => $_POST['sync1'], 'SYNC2' => $_POST['sync2']);
            $result = checkAndActivate($fields);
        }
        response($result);
        break;
    case 'deactivate':
        $result = deactivate($userId, $request->getPost('days'));
        response($result);
        break;
    case 'deffer':
        $result = deffer($userId, $request->getPost('days'));
        response($result);
        break;
    case 'activate':
        $result = activate($userId);
        response($result);
        break;
    case 'get_recovery_codes':
        $result = getRecoveryCodes($userId, $request->getPost('allow_regenerate') === 'Y');
        response($result);
        break;
    case 'regenerate_recovery_codes':
        $result = regenerateRecoveryCodes($userId);
        response($result);
        break;
    default:
        response(array('status' => 'error', 'error' => 'ACTION_NOT_FOUND'));
}
function response($result)
{
Ejemplo n.º 22
0
 if ($allow_ambient_peer_restart == 1 && $allow_ambient_peer_restart !== FALSE) {
     // Check to make sure Timekoin has not be stopped for any unknown reason
     $script_loop_active = mysql_result(mysql_query("SELECT * FROM `main_loop_status` WHERE `field_name` = 'main_heartbeat_active' LIMIT 1"), 0, "field_data");
     $script_last_heartbeat = mysql_result(mysql_query("SELECT * FROM `main_loop_status` WHERE `field_name` = 'main_last_heartbeat' LIMIT 1"), 0, "field_data");
     if ($script_loop_active > 0) {
         // Main should still be active
         if (time() - $script_last_heartbeat > 60) {
             // Main stop was unexpected
             write_log("Main Timekoin Processor has Failed, going to try an Ambient Peer Restart", "PL");
             // Database Initialization
             initialization_database();
             mysql_query("UPDATE `main_loop_status` SET `field_data` = '" . time() . "' WHERE `main_loop_status`.`field_name` = 'main_last_heartbeat' LIMIT 1");
             // Set loop at active now
             mysql_query("UPDATE `main_loop_status` SET `field_data` = '1' WHERE `main_loop_status`.`field_name` = 'main_heartbeat_active' LIMIT 1");
             call_script("main.php");
             activate(TIMEKOINSYSTEM, 1);
             // In case this was disabled from a emergency stop call in the server GUI
         }
     }
     // Check watchdog script to make sure it is still running
     $script_loop_active = mysql_result(mysql_query("SELECT * FROM `main_loop_status` WHERE `field_name` = 'watchdog_heartbeat_active' LIMIT 1"), 0, "field_data");
     $script_last_heartbeat = mysql_result(mysql_query("SELECT * FROM `main_loop_status` WHERE `field_name` = 'watchdog_last_heartbeat' LIMIT 1"), 0, "field_data");
     if ($script_loop_active > 0) {
         // Watchdog should still be active
         if (time() - $script_last_heartbeat > 100) {
             // Watchdog stop was unexpected
             write_log("Watchdog has Failed, going to try an Ambient Peer Restart", "PL");
             mysql_query("UPDATE `main_loop_status` SET `field_data` = '" . time() . "' WHERE `main_loop_status`.`field_name` = 'watchdog_last_heartbeat' LIMIT 1");
             // Set loop at active now
             mysql_query("UPDATE `main_loop_status` SET `field_data` = '1' WHERE `main_loop_status`.`field_name` = 'watchdog_heartbeat_active' LIMIT 1");
             call_script("watchdog.php", 0);
Ejemplo n.º 23
0
 function toggle($table, $id, $field, $value)
 {
     $Herb =& get_instance();
     $query = "SELECT * FROM `" . $table . "` WHERE id = '" . $id . "';";
     $res = $Herb->db->query($query);
     $row = $res->result_array();
     if (flag($row[$field], $value)) {
         deactivate($table, $id, $field, $value);
     } else {
         activate($table, $id, $field, $value);
     }
 }