Completed
Pull Request — master (#24)
by Lars
12:05
created
src/Intraface/Auth/User.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
         $result = $this->db->query("SELECT id FROM user WHERE email = ".$this->db->quote($this->email, 'text')." AND password = ".$this->db->quote(md5($this->password), 'text'));
41 41
 
42 42
         if (PEAR::isError($result)) {
43
-            throw new Exception('result is an error' . $result->getMessage() . $result->getUserInfo());
43
+            throw new Exception('result is an error'.$result->getMessage().$result->getUserInfo());
44 44
         }
45 45
 
46 46
         if ($result->numRows() != 1) {
@@ -48,9 +48,9 @@  discard block
 block discarded – undo
48 48
         }
49 49
         $row = $result->fetchRow(MDB2_FETCHMODE_ASSOC);
50 50
 
51
-        $result = $this->db->exec("UPDATE user SET lastlogin = NOW(), session_id = ".$this->db->quote($this->session_id, 'text')." WHERE id = ". $this->db->quote($row['id'], 'integer'));
51
+        $result = $this->db->exec("UPDATE user SET lastlogin = NOW(), session_id = ".$this->db->quote($this->session_id, 'text')." WHERE id = ".$this->db->quote($row['id'], 'integer'));
52 52
         if (PEAR::isError($result)) {
53
-            throw new Exception('could not update user ' . $result->getMessage() . $result->getUserInfo());
53
+            throw new Exception('could not update user '.$result->getMessage().$result->getUserInfo());
54 54
         }
55 55
 
56 56
         $user = new Intraface_User($row['id']);
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
     {
68 68
         $result = $this->db->query("SELECT id FROM user WHERE session_id = ".$this->db->quote($this->session_id, 'text'));
69 69
         if (PEAR::isError($result)) {
70
-            throw new Exception('could not check if user is logged in ' . $result->getUserInfo());
70
+            throw new Exception('could not check if user is logged in '.$result->getUserInfo());
71 71
         }
72 72
 
73 73
         if ($result->numRows() == 0) {
@@ -85,10 +85,10 @@  discard block
 block discarded – undo
85 85
      */
86 86
     public function logout()
87 87
     {
88
-        $result = $this->db->exec("UPDATE user SET session_id = " . $this->db->quote('', 'text') . " WHERE session_id = " . $this->db->quote($this->session_id, 'text'));
88
+        $result = $this->db->exec("UPDATE user SET session_id = ".$this->db->quote('', 'text')." WHERE session_id = ".$this->db->quote($this->session_id, 'text'));
89 89
 
90 90
         if (PEAR::isError($result)) {
91
-             throw new Exception('could not log user out ' . $result->getUserInfo());
91
+             throw new Exception('could not log user out '.$result->getUserInfo());
92 92
         }
93 93
         return true;
94 94
     }
Please login to merge, or discard this patch.
src/Intraface/Fileimport/Controller/Index.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
             'fileimport' => $this->fileimport
37 37
         );
38 38
 
39
-        $tpl = $this->template->create(dirname(__FILE__) . '/templates/index');
39
+        $tpl = $this->template->create(dirname(__FILE__).'/templates/index');
40 40
         return $tpl->render($this, $data);
41 41
     }
42 42
 
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
                     $_SESSION['shared_fileimport_data'] = $data;
101 101
                     $this->session()->set('fileimport_data', $data);
102 102
 
103
-                    return new k_SeeOther($this->url('../', array('header' => $this->body('header'),'file_id' => $this->filehandler->get('id'), 'fields' => $this->body('fields'))));
103
+                    return new k_SeeOther($this->url('../', array('header' => $this->body('header'), 'file_id' => $this->filehandler->get('id'), 'fields' => $this->body('fields'))));
104 104
 
105 105
                     /*
106 106
 
Please login to merge, or discard this patch.
src/Intraface/Kernel.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
         }
42 42
         $this->db = MDB2:: singleton(DB_DSN);
43 43
         if (PEAR::isError($this->db)) {
44
-            throw new Exception($this->db->getMessage() . $this->db->getUserInfo());
44
+            throw new Exception($this->db->getMessage().$this->db->getUserInfo());
45 45
         }
46 46
     }
47 47
 
Please login to merge, or discard this patch.
src/Intraface/Doctrine/Template/Listener/Intranet.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -8,16 +8,16 @@  discard block
 block discarded – undo
8 8
         $invoker = $event->getInvoker();
9 9
         $class   = get_class($invoker);
10 10
 
11
-        $field = $params['alias'] . '.intranet_id';
11
+        $field = $params['alias'].'.intranet_id';
12 12
         $query = $event->getQuery();
13 13
 
14 14
         // if it is not the class from FROM statement, it is left or inner join.
15 15
         // then we add the possibility for IS NULL. Actually it is only relevant in
16 16
         // left join, but how do we find out which kind of join it is?
17 17
         if ($query->contains('FROM '.$class)) {
18
-            $query->addWhere($field . '  = ?', array($this->getIntranetId()));
18
+            $query->addWhere($field.'  = ?', array($this->getIntranetId()));
19 19
         } else {
20
-            $query->addWhere('('.$field.' IS NULL OR '.$field . '  = ?)', array($this->getIntranetId()));
20
+            $query->addWhere('('.$field.' IS NULL OR '.$field.'  = ?)', array($this->getIntranetId()));
21 21
         }
22 22
     }
23 23
 
@@ -36,9 +36,9 @@  discard block
 block discarded – undo
36 36
     public function preDqlDelete(Doctrine_Event $event)
37 37
     {
38 38
         $params = $event->getParams();
39
-        $field = $params['alias'] . '.intranet_id';
39
+        $field = $params['alias'].'.intranet_id';
40 40
         $query = $event->getQuery();
41
-        $query->addWhere($field . ' = ?', array($this->getIntranetId()));
41
+        $query->addWhere($field.' = ?', array($this->getIntranetId()));
42 42
     }
43 43
 
44 44
     private function getIntranetId()
Please login to merge, or discard this patch.
src/Intraface/shared/email/EmailGateway.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -56,14 +56,14 @@  discard block
 block discarded – undo
56 56
     function findCountByContactId($contact_id)
57 57
     {
58 58
         $db = new DB_Sql;
59
-        $db->query('SELECT * FROM email WHERE contact_id = ' . $contact_id);
59
+        $db->query('SELECT * FROM email WHERE contact_id = '.$contact_id);
60 60
         return $db->numRows();
61 61
     }
62 62
 
63 63
     function setNewContactId($old_contact_id, $new_contact_id)
64 64
     {
65 65
         $db = new DB_Sql;
66
-        $db->query('UPDATE email SET contact_id = ' . $new_contact_id . ' WHERE contact_id = ' . $old_contact_id);
66
+        $db->query('UPDATE email SET contact_id = '.$new_contact_id.' WHERE contact_id = '.$old_contact_id);
67 67
         return true;
68 68
     }
69 69
 
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
     function countQueue()
79 79
     {
80 80
         $db = new DB_Sql;
81
-        $db->query("SELECT COUNT(*) AS antal FROM email WHERE status = 2 AND intranet_id = " . $this->kernel->intranet->get('id'));
81
+        $db->query("SELECT COUNT(*) AS antal FROM email WHERE status = 2 AND intranet_id = ".$this->kernel->intranet->get('id'));
82 82
         $this->value['outbox'] = 0;
83 83
         if ($db->nextRecord()) {
84 84
             $this->value['outbox'] = $db->f('antal');
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
             $list[$i]['status'] = $this->status[$db->f('status')];
100 100
 
101 101
             if ($db->f('contact_id') == 0) {
102
-                $this->error->set('Kan ikke finde #' . $db->f('id') . ' fordi den ikke har noget kontakt_id');
102
+                $this->error->set('Kan ikke finde #'.$db->f('id').' fordi den ikke har noget kontakt_id');
103 103
                 continue;
104 104
             }
105 105
             $this->kernel->useModule('contact');
@@ -133,13 +133,13 @@  discard block
 block discarded – undo
133 133
     {
134 134
         $sent_this_hour = $this->sentThisHour();
135 135
 
136
-        $limit_query = abs($this->allowed_limit-$sent_this_hour-$this->system_buffer);
136
+        $limit_query = abs($this->allowed_limit - $sent_this_hour - $this->system_buffer);
137 137
 
138 138
         $sql = "SELECT id
139 139
                 FROM email
140 140
                 WHERE status = 2
141 141
                     AND date_deadline <= NOW()
142
-                    AND intranet_id = " . $this->kernel->intranet->get('id') . "
142
+                    AND intranet_id = " . $this->kernel->intranet->get('id')."
143 143
                     AND contact_id > 0
144 144
                 LIMIT " . $limit_query;
145 145
         $db = new DB_Sql;
Please login to merge, or discard this patch.
src/Intraface/ModuleGateway.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
 
17 17
     public function __construct(MDB2_Driver_Common $db)
18 18
     {
19
-        $this->db =  $db;
19
+        $this->db = $db;
20 20
         $this->error = new Intraface_Error;
21 21
     }
22 22
 
Please login to merge, or discard this patch.
src/Intraface/Keyword/Controller/Index.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
 
14 14
     function renderHtml()
15 15
     {
16
-        return get_class($this) . ': intentionally left blank';
16
+        return get_class($this).': intentionally left blank';
17 17
     }
18 18
 
19 19
     function getModel()
Please login to merge, or discard this patch.
src/Intraface/Filehandler/Controller/Show.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 
29 29
     function renderHtml()
30 30
     {
31
-        $this->document->setTitle('File') . ': ' . $this->getFile()->get('file_name');
31
+        $this->document->setTitle('File').': '.$this->getFile()->get('file_name');
32 32
 
33 33
         $this->getKernel()->useShared('keyword');
34 34
         $keyword = new Intraface_Keyword_Appender($this->getFile());
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
             'kernel'      => $this->getKernel(),
40 40
             'keywords'    => $keywords);
41 41
 
42
-        $tpl = $this->template->create(dirname(__FILE__) . '/../templates/show');
42
+        $tpl = $this->template->create(dirname(__FILE__).'/../templates/show');
43 43
         return $tpl->render($this, $data);
44 44
     }
45 45
 
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
         $data = array('filemanager' => $this->getFile(),
56 56
                       'values' => $values);
57 57
 
58
-        $tpl = $this->template->create(dirname(__FILE__) . '/../templates/edit');
58
+        $tpl = $this->template->create(dirname(__FILE__).'/../templates/edit');
59 59
         return $tpl->render($this, $data);
60 60
     }
61 61
 
Please login to merge, or discard this patch.
src/Intraface/Filehandler/Controller/Viewer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
             } else {
32 32
                 $query = 'query_parts[1] is empty';
33 33
             }
34
-            $response = new k_TextResponse('Could not login using the key ' . $query);
34
+            $response = new k_TextResponse('Could not login using the key '.$query);
35 35
             $response->setStatus(403);
36 36
             return $response;
37 37
         }
Please login to merge, or discard this patch.