mirror of
https://bitbucket.org/jsuto/piler.git
synced 2025-06-12 23:37:02 +02:00
updated the group handling + revised admin permissions
This commit is contained in:
@ -57,8 +57,6 @@ class ModelSearchMessage extends Model {
|
||||
public function get_message_headers($id = '') {
|
||||
$data = '';
|
||||
|
||||
//$f = $this->get_store_path($id);
|
||||
//$msg = $this->decrypt_and_uncompress_file($f.".m");
|
||||
$msg = $this->get_raw_message($id);
|
||||
|
||||
$pos = strpos($msg, "\n\r\n");
|
||||
@ -95,8 +93,6 @@ class ModelSearchMessage extends Model {
|
||||
|
||||
$msg = $this->get_raw_message($id);
|
||||
|
||||
//print "a: $msg\n";
|
||||
|
||||
$a = explode("\n", $msg); $msg = "";
|
||||
|
||||
while(list($k, $l) = each($a)){
|
||||
@ -166,7 +162,7 @@ class ModelSearchMessage extends Model {
|
||||
if($this->check_boundary($boundary, $l) == 1){
|
||||
|
||||
if($text_plain == 1 || $has_text_plain == 0) {
|
||||
$message .= $this->flush_body_chunk($body_chunk, $charset, $qp, $base64, $text_plain, $text_html);
|
||||
$message .= $this->flush_body_chunk($body_chunk, $charset, $qp, $base64, $text_plain, $text_html);
|
||||
}
|
||||
|
||||
$text_plain = $text_html = $qp = $base64 = 0;
|
||||
@ -235,7 +231,6 @@ class ModelSearchMessage extends Model {
|
||||
$chunk = preg_replace("/</", "<", $chunk);
|
||||
$chunk = preg_replace("/>/", ">", $chunk);
|
||||
|
||||
//$chunk = "<pre>\n" . $this->print_nicely($chunk) . "</pre>\n";
|
||||
$chunk = preg_replace("/\n/", "<br />\n", $chunk);
|
||||
$chunk = "\n" . $this->print_nicely($chunk);
|
||||
}
|
||||
|
@ -104,7 +104,7 @@ class ModelSearchSearch extends Model {
|
||||
$data['subject'] = $this->fixup_sphinx_operators($data['subject']);
|
||||
|
||||
|
||||
if(Registry::get('admin_user') == 1 || Registry::get('auditor_user') == 1) {
|
||||
if(Registry::get('auditor_user') == 1) {
|
||||
if($data['f_from']) { $f1 .= "|" . $data['f_from']; $n_fc++; }
|
||||
if($data['o_from']) { $f1 .= "|" . $data['o_from']; $n_fc++; }
|
||||
if($data['from_domain']) { $fd .= "(@fromdomain " . substr($data['from_domain'], 1, strlen($data['from_domain'])) . ")"; $n_fc++; }
|
||||
@ -174,7 +174,7 @@ class ModelSearchSearch extends Model {
|
||||
private function assemble_simple_query_conditions($data = array(), $sort = 'sent', $order = 'DESC', $sortorder = '', $cache_key = '') {
|
||||
$email = $match = "";
|
||||
|
||||
if(Registry::get('admin_user') == 0 && Registry::get('auditor_user') == 0) {
|
||||
if(Registry::get('auditor_user') == 0) {
|
||||
|
||||
$all_your_addresses = $this->get_all_your_address();
|
||||
|
||||
@ -404,7 +404,7 @@ class ModelSearchSearch extends Model {
|
||||
public function get_message_recipients($id = '') {
|
||||
$rcpt = array();
|
||||
|
||||
if(Registry::get('admin_user') == 0 && Registry::get('auditor_user') == 0) { return $rcpt; }
|
||||
if(Registry::get('auditor_user') == 0) { return $rcpt; }
|
||||
|
||||
$query = $this->db->query("SELECT `to` FROM " . VIEW_MESSAGES . " WHERE piler_id=?", array($id));
|
||||
|
||||
@ -434,7 +434,7 @@ class ModelSearchSearch extends Model {
|
||||
|
||||
if($id == '') { return 0; }
|
||||
|
||||
if(Registry::get('admin_user') == 1 || Registry::get('auditor_user') == 1) { return 1; }
|
||||
if(Registry::get('auditor_user') == 1) { return 1; }
|
||||
|
||||
array_push($arr, $id);
|
||||
|
||||
@ -463,7 +463,7 @@ class ModelSearchSearch extends Model {
|
||||
|
||||
if(count($id) < 1) { return array(); }
|
||||
|
||||
if(Registry::get('admin_user') == 1 || Registry::get('auditor_user') == 1) { return $id; }
|
||||
if(Registry::get('auditor_user') == 1) { return $id; }
|
||||
|
||||
$arr = $id;
|
||||
|
||||
|
Reference in New Issue
Block a user