--- /dev/null
+<?php
+/*
+ * brisk - singlemsg.php
+ *
+ * Copyright (C) 2014 Matteo Nastasi
+ * mailto: nastasi@alternativeoutput.it
+ * matteo.nastasi@milug.org
+ * web: http://www.alternativeoutput.it
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABLILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details. You should have received a
+ * copy of the GNU General Public License along with this program; if
+ * not, write to the Free Software Foundation, Inc, 59 Temple Place -
+ * Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+$G_base = "";
+
+require_once("Obj/brisk.phh");
+require_once("Obj/user.phh");
+require_once("Obj/auth.phh");
+require_once("Obj/dbase_${G_dbasetype}.phh");
+
+
+$mlang_singlemsg = array( 'headline' => array('it' => 'briscola chiamata in salsa ajax',
+ 'en' => 'declaration briscola in ajax sauce <b>(Beta)</b>'),
+ 'content' => array('it' => 'C\'è qualche problema sul server.<br><br>Tra qualche istante questa pagina proverà a riconnettersi automaticamente.<br><br>Ci dispiace del disagio.',
+ 'en' => 'EN E\' occorso qualche problema sul server.<br>Questa pagina proverà automaticamente a riconnettersi tra qualche istante.<br>Ci dispiace per il disagio.' ) );
+
+function singlemsg($title, $msg, $redir_url=FALSE) {
+ GLOBAL $mlang_singlemsg, $G_is_local, $G_lang, $_SERVER;
+
+ $host = $_SERVER['HTTP_HOST'];
+ $uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
+
+ mt_srand(make_seed());
+ if ($redir_url) {
+ // $redir_url = "http://$host$uri/";
+ $redir_rnd = rand(15, 25);
+ $redir_meta = sprintf('<META HTTP-EQUIV="refresh" CONTENT="%d;URL=\'%s\'">', $redir_rnd, $redir_url);
+ }
+ else {
+ $redir_meta = "";
+ }
+?>
+<html>
+<head>
+ <title><?php echo $title; ?></title>
+<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="prefs.js"></script>
+<!-- <script type="text/javascript" src="myconsole.js"></script> -->
+<script type="text/javascript" src="menu.js"></script>
+<script type="text/javascript" src="heartbit.js"></script>
+<script type="text/javascript" src="xynt-streaming.js"></script>
+<script type="text/javascript" src="preload_img<?php echo langtolng($G_lang); ?>.js"></script>
+<script type="text/javascript" src="AC_OETags.js"></script>
+<script type="text/javascript" src="room.js"></script>
+<script type="text/javascript" src="md5.js"></script>
+<script type="text/javascript" src="probrowser.js"></script>
+<script type="text/javascript" src="json2.js"></script>
+<link rel="stylesheet" type="text/css" href="brisk.css">
+<link rel="stylesheet" type="text/css" href="room.css">
+</head>
+ <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) {
+ $banner_top_left = '<script type="text/javascript"><!--
+google_ad_client = "pub-5246925322544303";
+google_ad_width = 234;
+google_ad_height = 60;
+google_ad_format = "234x60_as";
+google_ad_type = "text_image";
+google_ad_channel = "";
+google_color_border = "808080";
+google_color_bg = "f6f6f6";
+google_color_link = "ffae00";
+google_color_text = "404040";
+google_color_url = "000000";
+//-->
+</script>
+<script type="text/javascript"
+ src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
+</script>';
+ $banner_top_right = carousel_top();
+ }
+ else {
+ $banner_top_left = carousel_top();
+ $banner_top_right = '<script type="text/javascript"><!--
+google_ad_client = "pub-5246925322544303";
+google_ad_width = 234;
+google_ad_height = 60;
+google_ad_format = "234x60_as";
+google_ad_type = "text_image";
+google_ad_channel = "";
+google_color_border = "808080";
+google_color_bg = "f6f6f6";
+google_color_link = "ffae00";
+google_color_text = "404040";
+google_color_url = "000000";
+//-->
+</script>
+<script type="text/javascript"
+ src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
+</script>';
+ }
+ }
+ else { // !$G_is_local
+ $banner_top_left = carousel_top();
+ $banner_top_right = carousel_top();
+ }
+
+ $brisk_header_form = '<div class="container">
+<!-- =========== header =========== -->
+<div id="header" class="header">
+<table width="100%%" border="0" cols="3"><tr>
+<td align="left"><div style="padding-left: 8px;">'.$banner_top_left.'</div></td>
+<td align="center"><div style="text-align: center;">
+ <img class="nobo" src="img/brisk_logo64.png">
+ '.$mlang_singlemsg['headline'][$G_lang].'<br>
+ </div></td>
+<td align="right"><div style="padding-right: 8px;">
+'.$banner_top_right.'</div></td>
+</tr></table>
+</div>';
+
+ printf($brisk_header_form);
+?>
+
+<div style="text-align: center; font-size: 24px; height: 600px;">
+ <div style="height: 200px;"></div>
+ <?php echo $msg; ?>
+</div>
+
+<div id="imgct"></div>
+<div id="logz"></div>
+<div id="sandbox"></div>
+<div id="sandbox2"></div>
+<div id="response"></div>
+<div id="xhrstart"></div>
+<pre>
+<div id="xhrlog"></div>
+</pre>
+<div id="xhrdeltalog"></div>
+</body>
+</html>
+<?php
+ }
+
+
+// singlemsg("Ci siamo title", "Ci siamo");
+
+?>
\ No newline at end of file
define('USER_FLAG_TY_DISABLE', 0x800000); // done
// ... reasons for disabling account ...
+define('USER_DIS_REA_NONE', 0);
define('USER_DIS_REA_INVMAIL', 1);
define('USER_DIS_REA_LICENCE', 2);
define('USER_DIS_REA_BANNED', 3);
define('USER_DIS_REA_MALICIOUS', 4);
-define('USER_DIS_REA_NU_MAILED', 5);
-define('USER_DIS_REA_NU_TOBECHK', 6);
+define('USER_DIS_REA_NU_MAILED', 5); // new user: mail sent to be confirmed
+define('USER_DIS_REA_NU_TOBECHK', 6); // new user: name verification
'Ciao, sono l\' amministratore del sito di Brisk.
L\' utente \'%s\' ha garantito per te col nickname \'%s\',
-vai al link: %s/mailmgr.php?code=%d&hash=%s
+vai al link: %s
per confermare il tuo indirizzo di posta elettronica.
Ciò è necessario per ottenere la password.
Saluti e buone partite, mop.',
- 'en' => 'EN mtext [%s] [%s] [%s] [%d] [%s]'),
+ 'en' => 'EN mtext [%s] [%s] [%s]'),
'nu_mhtml' => array( 'it' => 'Ciao, sono l\' amministratore del sito di Brisk.<br><br>
L\' utente \'%s\' ha garantito per te col nickname \'%s\',<br>
-<a href="%s/mailmgr.php?code=%d&hash=%s">clicca qui</a> per confermare il tuo indirizzo di posta elettronica.<br><br>
+<a href="%s">clicca qui</a> per confermare il tuo indirizzo di posta elettronica.<br><br>
Ciò è necessario per ottenere la password.<br><br>
Saluti e buone partite, mop.<br>',
- 'en' => 'EN mhtml [%s] [%s] [%s] [%d] [%s]'),
+ 'en' => 'EN mhtml [%s] [%s] [%s]'),
'nu_gtext' => array( 'it' =>
'Ciao %s, sono l\' amministratore del sito di Brisk.
$bdb->transaction('BEGIN');
$is_trans = TRUE;
// insert the new user disabled with reason NU_MAILED
- /*
- * FIXME: password management
- */
- $the_pass = "LA PASSWORD";
-
- if (($usr_obj = $bdb->user_add($cli_name, $the_pass, $cli_email,
+ if (($usr_obj = $bdb->user_add($cli_name, 'THE_PASS', $cli_email,
USER_FLAG_TY_DISABLE,
- USER_DIS_REA_NU_TOBECHK, $user->code)) == FALSE) {
+ USER_DIS_REA_NU_MAILED, $user->code)) == FALSE) {
fprintf(STDERR, "ERROR: user_add FAILED\n");
break;
}
fprintf(STDERR, "ERROR: mail reserve code FAILED\n");
break;
}
- $hash = md5($curtime . $G_alarm_passwd . $cli_name . $the_pass . $cli_email);
+ $hash = md5($curtime . $G_alarm_passwd . $cli_name . $cli_email);
- $confirm_page = sprintf("http://%s/%s/mailcheck.php", $G_domain, $G_webbase);
+ $confirm_page = sprintf("http://%s/%s/mailmgr.php?f_act=checkmail&f_code=%d&f_hash=%s",
+ $G_domain, $G_webbase, $mail_code, $hash);
$subj = $mlang_indwr['nu_msubj'][$G_lang];
$body_txt = sprintf($mlang_indwr['nu_mtext'][$G_lang],
- $user->name, $cli_name, $confirm_page, $mail_code, $hash);
+ $user->name, $cli_name, $confirm_page);
$body_htm = sprintf($mlang_indwr['nu_mhtml'][$G_lang],
- $user->name, $cli_name, $confirm_page, $mail_code, $hash);
+ $user->name, $cli_name, $confirm_page);
$mail_item = new MailDBItem($mail_code, $usr_obj->code, MAIL_TYP_CHECK,
$curtime, $subj, $body_txt, $body_htm, $hash);
+++ /dev/null
-<?php
-/*
- * brisk - index_wr.php
- *
- * Copyright (C) 2014 Matteo Nastasi
- * mailto: nastasi@alternativeoutput.it
- * matteo.nastasi@milug.org
- * web: http://www.alternativeoutput.it
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABLILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details. You should have received a
- * copy of the GNU General Public License along with this program; if
- * not, write to the Free Software Foundation, Inc, 59 Temple Place -
- * Suite 330, Boston, MA 02111-1307, USA.
- *
- */
-
-echo "code: $code<br>";
-echo "hash: $hash<br>";
-
-exit;
-?>
\ No newline at end of file
--- /dev/null
+<?php
+/*
+ * brisk - mailmgr.php
+ *
+ * Copyright (C) 2014 Matteo Nastasi
+ * mailto: nastasi@alternativeoutput.it
+ * matteo.nastasi@milug.org
+ * web: http://www.alternativeoutput.it
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABLILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details. You should have received a
+ * copy of the GNU General Public License along with this program; if
+ * not, write to the Free Software Foundation, Inc, 59 Temple Place -
+ * Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+$G_base = "";
+
+ini_set("max_execution_time", "240");
+
+require_once($G_base."Obj/brisk.phh");
+require_once($G_base."Obj/user.phh");
+require_once($G_base."Obj/auth.phh");
+require_once($G_base."Obj/dbase_${G_dbasetype}.phh");
+require_once($G_base."Obj/singlemsg.phh");
+
+require_once($G_base."spush/brisk-spush.phh");
+
+define('MAILMGR_CHECKMAIL', 1);
+
+function main() {
+ // GLOBAL $G_dbpfx, $G_alarm_passwd, $f_mailusers, $sess, $_POST, $_SERVER;
+ GLOBAL $G_dbpfx, $f_act, $f_code, $f_hash;
+
+ /* echo "act: $f_act<br>";
+ echo "code: $f_code<br>";
+ echo "hash: $f_hash<br>"; */
+
+ if ($f_act == "checkmail") {
+ $errcode = 10000;
+ do {
+ if (($bdb = BriskDB::create()) == FALSE) {
+ log_crit("stat-day: database connection failed");
+ $errcode = 10001;
+ break;
+ }
+ $bdb->transaction('BEGIN');
+
+ if (($mai = $bdb->mail_check($f_code, MAILMGR_CHECKMAIL, $f_hash)) == FALSE) {
+ $errcode = 10002;
+ break;
+ }
+
+ if (($bdb->user_update_flag_ty($mai->ucode,
+ USER_FLAG_TY_DISABLE, USER_DIS_REA_NU_MAILED,
+ USER_FLAG_TY_DISABLE, USER_DIS_REA_NU_TOBECHK)) == FALSE) {
+ $errcode = 10003;
+ break;
+ }
+
+ if (($mai = $bdb->mail_delete($f_code)) == FALSE) {
+ $errcode = 10004;
+ break;
+ }
+ $bdb->transaction('COMMIT');
+
+ singlemsg("Verifica della e-mail andata a buon fine.", "Verifica della e-mail andata a buon fine.");
+ $errcode = 0;
+ } while (FALSE);
+ if ($errcode) {
+ singlemsg("E' occorso un errore durante la verifica della e-mail.",
+ sprintf("E' occorso un errore durante la verifica della e-mail.<br><br>Codice d'errore: %d.<br>", $errcode));
+ $bdb->transaction('ROLLBACK');
+ }
+ }
+
+ exit;
+}
+
+main();
+?>
\ No newline at end of file
$G_base = "";
-$mlang_stat_day = array( 'normal match'=> array( 'it' => 'Partite normali',
- 'en' => 'Normal matches' ),
- 'special match' => array( 'it' => 'Partite speciali',
- 'en' => 'Special matches'),
+$mlang_umgmt = array( 'nu_psubj' => array( 'it' => 'Brisk: credenziali di accesso.',
+ 'en' => 'Brisk: credentials.'),
+ 'nu_ptext' => array( 'it' =>
+'Ciao, sono l\' amministratore del sito di Brisk.
+
+La verifica del tuo indirizzo di posta elettronica e del tuo nickname è andata a buon fine, per accedere al sito
+d\'ora in poi potrai utilizzare l\' utente \'%s\' e la password \'%s\'.
+
+Benvenuto e buone partite, mop.',
+ 'en' => 'EN ptext [%s] [%s]'),
+ 'nu_phtml' => array( 'it' => 'Ciao, sono l\' amministratore del sito di Brisk.<br><br>
+La verifica del tuo indirizzo di posta elettronica e del tuo nickname è andata a buon fine, per accedere al sito d\'ora in poi potrai usare l\' utente \'%s\' e la password \'%s\'.<br>
+Benvenuto e buone partite, mop.<br>',
+ 'en' => 'EN phtml [%s] [%s]')
+ );
- 'info_total'=> array( 'it' => 'totali',
- 'en' => 'En totali')
- );
ini_set("max_execution_time", "240");
require_once($G_base."Obj/brisk.phh");
require_once($G_base."Obj/user.phh");
require_once($G_base."Obj/auth.phh");
+require_once($G_base."Obj/mail.phh");
require_once($G_base."Obj/dbase_${G_dbasetype}.phh");
require_once($G_base."briskin5/Obj/briskin5.phh");
require_once($G_base."briskin5/Obj/placing.phh");
}
function main() {
- GLOBAL $G_dbpfx, $G_alarm_passwd, $f_mailusers, $sess, $_POST, $_SERVER;
+ GLOBAL $G_dbpfx, $G_lang, $G_alarm_passwd, $mlang_umgmt, $f_mailusers, $sess, $_POST, $_SERVER;
if (check_auth() == FALSE) {
echo "Authentication failed";
printf("KEY: %s: %s %s<br>\n", $id, $value, $usr_obj->login);
// change state
+ $passwd = passwd_gen();
+
+ if (($bdb->user_update_passwd($usr_obj->code, $passwd)) == FALSE) {
+ echo "fail 1.5<br>";
+ break;
+ }
+
+ if (($bdb->user_update_flag_ty($usr_obj->code,
+ USER_FLAG_TY_DISABLE, USER_DIS_REA_NU_TOBECHK,
+ USER_FLAG_TY_NORM, USER_DIS_REA_NU_NONE)) == FALSE) {
+ echo "fail 2<br>";
+ break;
+ }
+
// send mail
- // populate
+ $subj = $mlang_umgmt['nu_psubj'][$G_lang];
+ $body_txt = sprintf($mlang_umgmt['nu_ptext'][$G_lang],
+ $usr_obj->login, $passwd);
+ $body_htm = sprintf($mlang_umgmt['nu_phtml'][$G_lang],
+ $usr_obj->login, $passwd);
+
+ if (brisk_mail($usr_obj->email, $subj, $body_txt, $body_htm) == FALSE) {
+ // mail error
+ fprintf(STDERR, "ERROR: mail send FAILED\n");
+ break;
+ }
}
exit;
}
--- /dev/null
+<?php
+/*
+ * brisk - singlemsg.php
+ *
+ * Copyright (C) 2014 Matteo Nastasi
+ * mailto: nastasi@alternativeoutput.it
+ * matteo.nastasi@milug.org
+ * web: http://www.alternativeoutput.it
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABLILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details. You should have received a
+ * copy of the GNU General Public License along with this program; if
+ * not, write to the Free Software Foundation, Inc, 59 Temple Place -
+ * Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+$G_base = "";
+
+require_once("Obj/brisk.phh");
+require_once("Obj/user.phh");
+require_once("Obj/auth.phh");
+require_once("Obj/dbase_${G_dbasetype}.phh");
+require_once("Obj/singlemsg.phh");
+
+
+singlemsg("Ci siamo title", "Ci siamo fun");
+
+?>
\ No newline at end of file