* brisk - test/nonblocking.php
*
* Copyright (C) 2014 Matteo Nastasi
- * mailto: nastasi@alternativeoutput.it
+ * mailto: nastasi@alternativeoutput.it
* matteo.nastasi@milug.org
* web: http://www.alternativeoutput.it
*
}
}
-function main()
+function main()
{
GLOBAL $blocking_mode;
if (file_exists($file_socket)) {
unlink($file_socket);
}
-
+
$old_umask = umask(0);
if (($list = stream_socket_server($unix_socket, $err, $errs)) === FALSE) {
return (FALSE);
umask($old_umask);
printf("Blocking mode (listen): %d\n", $blocking_mode);
stream_set_blocking($list, $blocking_mode); // Set the stream to non-blocking
-
+
while(1) {
printf("\nLOOP BEGIN\n");
if (($new_unix = stream_socket_accept($list)) == FALSE) {
}
main();
-?>
\ No newline at end of file
+?>
function user_add($login, $pass, $email, $type, $disa_reas, $guar_code) {
GLOBAL $G_dbpfx;
- $usr_sql = sprintf("INSERT INTO %susers (login, pass, email, type, disa_reas, guar_code)
+ $usr_sql = sprintf("INSERT INTO %susers (login, pass, email, type, disa_reas, guar_code)
VALUES ('%s', '%s', '%s', %d, %d, %d) RETURNING *;",
- $G_dbpfx, escsql(strtolower($login)), escsql($pass), escsql($email),
+ $G_dbpfx, escsql(strtolower($login)), escsql($pass), escsql($email),
$type, $disa_reas, $guar_code);
if (! (($usr_pg = $this->query($usr_sql)) != FALSE && pg_affected_rows($usr_pg) == 1) ) {
* brisk - singlemsg.php
*
* Copyright (C) 2014 Matteo Nastasi
- * mailto: nastasi@alternativeoutput.it
+ * mailto: nastasi@alternativeoutput.it
* matteo.nastasi@milug.org
* web: http://www.alternativeoutput.it
*
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<?php echo "$redir_meta\n"?>
<link rel="shortcut icon" href="img/brisk_ico.png">
-<script type="text/javascript" src="commons.js"></script>
+<script type="text/javascript" src="commons.js"></script>
<script type="text/javascript" src="prefs.js"></script>
<!-- <script type="text/javascript" src="myconsole.js"></script> -->
<script type="text/javascript" src="menu.js"></script>
<body style="/*background-image: url('img/saddysunbg.png');*/">
<?php
/* MLANG: "briscola chiamata in salsa ajax", */
-
+
mt_srand(make_seed());
if (!$G_is_local) {
$rn = rand(0, 1);
-
- if ($rn == 0) {
+
+ if ($rn == 0) {
$banner_top_left = '<script type="text/javascript"><!--
google_ad_client = "pub-5246925322544303";
google_ad_width = 234;
</script>';
$banner_top_right = carousel_top();
}
- else {
+ else {
$banner_top_left = carousel_top();
$banner_top_right = '<script type="text/javascript"><!--
google_ad_client = "pub-5246925322544303";
</div>';
printf($brisk_header_form);
-?>
+?>
<div style="text-align: center; font-size: 24px; height: 600px;">
<div style="height: 200px;"></div>
* brisk - mailmgr.php
*
* Copyright (C) 2014 Matteo Nastasi
- * mailto: nastasi@alternativeoutput.it
+ * mailto: nastasi@alternativeoutput.it
* matteo.nastasi@milug.org
* web: http://www.alternativeoutput.it
*
break;
}
$usr_obj = pg_fetch_object($usr_pg, 0);
-
+
printf("KEY: %s: %s %s<br>\n", $id, $value, $usr_obj->login);
// change state
$passwd = passwd_gen();
// retrieve list of active tournaments
$usr_sql = sprintf("
-SELECT usr.*, guar.login AS guar_login
- FROM %susers AS usr
- JOIN %susers AS guar ON guar.code = usr.guar_code
+SELECT usr.*, guar.login AS guar_login
+ FROM %susers AS usr
+ JOIN %susers AS guar ON guar.code = usr.guar_code
WHERE ( (usr.type & (CAST (X'%x' as integer))) = (CAST (X'%x' as integer)) )
- AND usr.disa_reas = %d;",
+ AND usr.disa_reas = %d;",
$G_dbpfx, $G_dbpfx,
USER_FLAG_TY_ALL, USER_FLAG_TY_DISABLE,
USER_DIS_REA_NU_TOBECHK);
log_crit("stat-day: select from tournaments failed");
break;
}
-
+
$usr_n = pg_numrows($usr_pg);
$tab_lines = "";
for ($i = 0 ; $i < $usr_n ; $i++) {
$usr_obj = pg_fetch_object($usr_pg, $i);
-
+
$tab_lines .= sprintf("<tr><td><input name=\"f_newuser%d\" type=\"checkbox\" CHECKED></td><td>%s</td><td></td></tr>\n",
$usr_obj->code, eschtml($usr_obj->login), eschtml($usr_obj->guar_login));
}
* brisk - singlemsg.php
*
* Copyright (C) 2014 Matteo Nastasi
- * mailto: nastasi@alternativeoutput.it
+ * mailto: nastasi@alternativeoutput.it
* matteo.nastasi@milug.org
* web: http://www.alternativeoutput.it
*
singlemsg("Ci siamo title", "Ci siamo fun");
-?>
\ No newline at end of file
+?>
* brisk - test_db.php
*
* Copyright (C) 2014 Matteo Nastasi
- * mailto: nastasi@alternativeoutput.it
+ * mailto: nastasi@alternativeoutput.it
* matteo.nastasi@milug.org
* web: http://www.alternativeoutput.it
*
}
main();
-?>
\ No newline at end of file
+?>