<?php
/***************************************************************************
- * Copyright (C) 2003-2010 Polytechnique.org *
+ * Copyright (C) 2003-2011 Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
function check_email($email, $message)
{
- $res = XDB::query("SELECT state, description
- FROM email_watch
- WHERE state != 'safe' AND email = {?}", $email);
- if ($res->numRows()) {
+ $res = XDB::fetchOneCell('SELECT COUNT(*)
+ FROM email_watch
+ WHERE state != \'safe\' AND email = {?}',
+ $email);
+ if ($res) {
send_warning_mail($message);
return true;
}
function check_account()
{
- return S::v('watch_account');
+ if (S::user()) {
+ return S::user()->watch;
+ }
+ return false;
}
function check_redirect($red = null)