Code Duplication    Length = 10-10 lines in 2 locations

src/Intraface/modules/contact/Contact.php 2 locations

@@ 884-893 (lines=10) @@
881
     *
882
     * @return boolean
883
     */
884
    function generateCode()
885
    {
886
        if ($this->id == 0) {
887
            return false;
888
        }
889
        $db = new DB_Sql;
890
        $db->query("UPDATE contact SET code = '".md5($this->id . date('Y-m-d H:i:s') . $this->kernel->intranet->get('id'))."' WHERE id = " . $this->id);
891
        $this->load();
892
        return true;
893
    }
894
895
896
    /**
@@ 901-910 (lines=10) @@
898
     *
899
     * @return boolean
900
     */
901
    function generatePassword()
902
    {
903
        if ($this->id == 0) {
904
            return false;
905
        }
906
        $db = new DB_Sql;
907
        $db->query("UPDATE contact SET password = '".md5($this->id . date('Y-m-d H:i:s') . $this->kernel->intranet->get('id'))."' WHERE id = " . $this->id);
908
        $this->load();
909
        return true;
910
    }
911
912
    /**
913
     * Gets the contacts newsletter subscriptions