- parent::__construct('axletter/letter.tpl', 'ax.css', 'ax/show');
+ parent::__construct('axletter/letter.tpl', 'ax.css', 'ax/show', 'axletter', 'axletter_ins');
list($this->_id, $this->_shortname, $this->_title_mail, $this->_title,
$this->_body, $this->_signature, $this->_promo_min, $this->_promo_max,
$this->_echeance, $this->_date, $this->_bits) = $id;
list($this->_id, $this->_shortname, $this->_title_mail, $this->_title,
$this->_body, $this->_signature, $this->_promo_min, $this->_promo_max,
$this->_echeance, $this->_date, $this->_bits) = $id;
FROM axletter_ins
WHERE user_id={?}", $user);
return $res->fetchOneCell();
FROM axletter_ins
WHERE user_id={?}", $user);
return $res->fetchOneCell();
static public function unsubscribe($uid = null, $hash = false)
{
$user = is_null($uid) ? S::v('uid') : $uid;
static public function unsubscribe($uid = null, $hash = false)
{
$user = is_null($uid) ? S::v('uid') : $uid;
- protected function subscriptionTable()
+ static public function grantPerms($uid)
+ {
+ if (!is_numeric($uid)) {
+ $res = XDB::query("SELECT id FROM aliases WHERE alias = {?}", $uid);
+ $uid = $res->fetchOneCell();
+ }
+ if (!$uid) {
+ return false;
+ }
+ return XDB::execute("INSERT IGNORE INTO axletter_rights SET user_id = {?}", $uid);
+ }
+
+ static public function revokePerms($uid)
+ if (!is_numeric($uid)) {
+ $res = XDB::query("SELECT id FROM aliases WHERE alias = {?}", $uid);
+ $uid = $res->fetchOneCell();
+ }
+ if (!$uid) {
+ return false;
+ }
+ return XDB::execute("DELETE FROM axletter_rights WHERE user_id = {?}", $uid);
$res = XDB::query("SELECT IF(shortname IS NULL, id, shortname) as id, date, subject AS titre
FROM axletter
WHERE NOT (FIND_IN_SET('new', bits))
ORDER BY date DESC");
return $res->fetchAllAssoc();
}
$res = XDB::query("SELECT IF(shortname IS NULL, id, shortname) as id, date, subject AS titre
FROM axletter
WHERE NOT (FIND_IN_SET('new', bits))
ORDER BY date DESC");
return $res->fetchAllAssoc();
}
$res = XDB::query("SELECT IF(shortname IS NULL, id, shortname) as id, date, subject AS titre
FROM axletter
ORDER BY date DESC");
$res = XDB::query("SELECT IF(shortname IS NULL, id, shortname) as id, date, subject AS titre
FROM axletter
ORDER BY date DESC");