Code Duplication    Length = 21-21 lines in 4 locations

src/logon/login.php 1 location

@@ 67-87 (lines=21) @@
64
{
65
    $error = login_user($username, $password);
66
67
    switch ($error)
68
    {
69
        case NO_ERROR:
70
            header('HTTP/1.0 200 OK');
71
            break;
72
73
        case ERROR_UNKNOWN_USERNAME:
74
            send_http_error(get_html_resource(RES_ALERT_UNKNOWN_USERNAME_ID));
75
            break;
76
77
        case ERROR_ACCOUNT_DISABLED:
78
            send_http_error(get_html_resource(RES_ALERT_ACCOUNT_DISABLED_ID));
79
            break;
80
81
        case ERROR_ACCOUNT_LOCKED:
82
            send_http_error(get_html_resource(RES_ALERT_ACCOUNT_LOCKED_ID));
83
            break;
84
85
        default:
86
            send_http_error(get_html_resource(RES_ALERT_UNKNOWN_ERROR_ID));
87
    }
88
}
89
90
?>

src/settings/password.php 1 location

@@ 61-81 (lines=21) @@
58
        $error = password_change($_SESSION[VAR_USERID], $password1);
59
    }
60
61
    switch ($error)
62
    {
63
        case NO_ERROR:
64
            header('HTTP/1.0 200 OK');
65
            break;
66
67
        case ERROR_INCOMPLETE_FORM:
68
            send_http_error(get_html_resource(RES_ALERT_REQUIRED_ARE_EMPTY_ID));
69
            break;
70
71
        case ERROR_PASSWORDS_DO_NOT_MATCH:
72
            send_http_error(get_html_resource(RES_ALERT_PASSWORDS_DO_NOT_MATCH_ID));
73
            break;
74
75
        case ERROR_PASSWORD_TOO_SHORT:
76
            send_http_error(ustrprocess(get_html_resource(RES_ALERT_PASSWORD_TOO_SHORT_ID), MIN_PASSWORD_LENGTH));
77
            break;
78
79
        default:
80
            send_http_error(get_html_resource(RES_ALERT_UNKNOWN_ERROR_ID));
81
    }
82
83
    exit;
84
}

src/subscriptions/create.php 1 location

@@ 166-186 (lines=21) @@
163
                                     $subscription_param);
164
    }
165
166
    switch ($error)
167
    {
168
        case NO_ERROR:
169
            header('HTTP/1.0 200 OK');
170
            break;
171
172
        case ERROR_INCOMPLETE_FORM:
173
            send_http_error(get_html_resource(RES_ALERT_REQUIRED_ARE_EMPTY_ID));
174
            break;
175
176
        case ERROR_ALREADY_EXISTS:
177
            send_http_error(get_html_resource(RES_ALERT_SUBSCRIPTION_ALREADY_EXISTS_ID));
178
            break;
179
180
        case ERROR_INVALID_EMAIL:
181
            send_http_error(get_html_resource(RES_ALERT_INVALID_EMAIL_ID));
182
            break;
183
184
        default:
185
            send_http_error(get_html_resource(RES_ALERT_UNKNOWN_ERROR_ID));
186
    }
187
188
    exit;
189
}

src/subscriptions/modify.php 1 location

@@ 83-103 (lines=21) @@
80
                                     $subscription_flags);
81
    }
82
83
    switch ($error)
84
    {
85
        case NO_ERROR:
86
            header('HTTP/1.0 200 OK');
87
            break;
88
89
        case ERROR_INCOMPLETE_FORM:
90
            send_http_error(get_html_resource(RES_ALERT_REQUIRED_ARE_EMPTY_ID));
91
            break;
92
93
        case ERROR_ALREADY_EXISTS:
94
            send_http_error(get_html_resource(RES_ALERT_SUBSCRIPTION_ALREADY_EXISTS_ID));
95
            break;
96
97
        case ERROR_INVALID_EMAIL:
98
            send_http_error(get_html_resource(RES_ALERT_INVALID_EMAIL_ID));
99
            break;
100
101
        default:
102
            send_http_error(get_html_resource(RES_ALERT_UNKNOWN_ERROR_ID));
103
    }
104
105
    exit;
106
}