Example #1
0
 /**
  * Replaces User::touchUser()
  */
 function invalidateCache()
 {
     $this->db->update('user', array('user_touched' => $this->db->timestamp()), array('user_id' => $this->id), __METHOD__);
     $wikiId = $this->db->getWikiID();
     $userId = $this->id;
     $this->db->onTransactionPreCommitOrIdle(function () use($wikiId, $userId) {
         User::purge($wikiId, $userId);
     });
 }
Example #2
0
<?php

/**
	/setup.php
	(C) Giovanni Capuano 2011
*/
$submit = isset($_POST['submit']) ? true : false;
$reg = isset($_POST['reg']) ? true : false;
$versione = '0.9';
if ($reg) {
    require_once 'core/class.User.php';
    $config = new User();
    $nickname = isset($_POST['nickname']) && $_POST['nickname'] !== '' ? $config->purge($_POST['nickname']) : '';
    $password = isset($_POST['password']) && $_POST['password'] !== '' ? $config->purge($_POST['password']) : '';
    $confPassword = isset($_POST['confPassword']) && $_POST['confPassword'] !== '' ? $config->purge($_POST['confPassword']) : '';
    $email = isset($_POST['email']) && $_POST['email'] !== '' ? $config->purge($_POST['email']) : '';
    if ($password == $confPassword && strlen($password) > 4 && strlen($nickname) > 4) {
        if ($config->createUser(array($nickname, $password, $email, 1, date('d-m-y'), date('G:m:s'), '', $config->config[0]->skin))) {
            echo '
			<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
			<html xmlns="http://www.w3.org/1999/xhtml">
			<head>
			<title>Setup &raquo; Ocarina2 CMS</title>
			<meta http-equiv="content-type" content="text/html; charset=utf-8" />
			</head>
			<body>
			<div align="center"><h1>Registrazione completata.<br />Ora elimina il file <b>setup.php</b></div>
			</body>
			</html>';
        } else {
            echo '