Code Duplication    Length = 9-13 lines in 3 locations

src/Intraface/Auth/User.php 1 location

@@ 86-94 (lines=9) @@
83
     *
84
     * @return boolean
85
     */
86
    public function logout()
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'));
89
90
        if (PEAR::isError($result)) {
91
             throw new Exception('could not log user out ' . $result->getUserInfo());
92
        }
93
        return true;
94
    }
95
96
    /**
97
     * Returns an identification string on the user

src/Intraface/modules/modulepackage/Manager.php 2 locations

@@ 215-227 (lines=13) @@
212
     *
213
     * @return boolean true or false
214
     */
215
    public function terminate()
216
    {
217
        if ($this->id == 0) {
218
            return false;
219
        }
220
221
        $result = $this->db->exec("UPDATE intranet_module_package SET status_key = 3 WHERE intranet_id = ".$this->intranet->get('id')." AND id = ".intval($this->id));
222
        if (PEAR::isError($result)) {
223
            throw new Exception("Error in query in Intraface_modules_modulepackage_Manager->terminate :". $result->getUserInfo());
224
        }
225
226
        return $result;
227
    }
228
229
    /**
230
     * Delete an intranet module package
@@ 234-245 (lines=12) @@
231
     *
232
     * @return boolean true or false
233
     */
234
    public function delete()
235
    {
236
        if ($this->id == 0) {
237
            return false;
238
        }
239
        $result = $this->db->exec("UPDATE intranet_module_package SET active = 0 WHERE intranet_id = ".$this->intranet->get('id')." AND id = ".intval($this->id));
240
        if (PEAR::isError($result)) {
241
            throw new Exception("Error in query in Intraface_modules_modulepackage_Manager->delete :". $result->getUserInfo());
242
        }
243
244
        return $result;
245
    }
246
247
    /**
248
     * Returns on the basis of the module package which type of add this is. Can be either add, extend, or upgrade