Code Duplication    Length = 9-12 lines in 4 locations

src/dbo/accounts.php 3 locations

@@ 124-132 (lines=9) @@
121
 * @param int $id Account ID.
122
 * @return int Always {@link NO_ERROR}.
123
 */
124
function account_disable ($id)
125
{
126
    debug_write_log(DEBUG_TRACE, '[account_disable]');
127
    debug_write_log(DEBUG_DUMP,  '[account_disable] $id = ' . $id);
128
129
    dal_query('accounts/disable.sql', $id, bool2sql(TRUE));
130
131
    return NO_ERROR;
132
}
133
134
/**
135
 * Enables specified account.
@@ 140-148 (lines=9) @@
137
 * @param int $id Account ID.
138
 * @return int Always {@link NO_ERROR}.
139
 */
140
function account_enable ($id)
141
{
142
    debug_write_log(DEBUG_TRACE, '[account_enable]');
143
    debug_write_log(DEBUG_DUMP,  '[account_enable] $id = ' . $id);
144
145
    dal_query('accounts/disable.sql', $id, bool2sql(FALSE));
146
147
    return NO_ERROR;
148
}
149
150
/**
151
 * Looks for Account ID and token, which are stored in client cookies,
@@ 739-750 (lines=12) @@
736
 * @param string $passwd New password string.
737
 * @return int Always {@link NO_ERROR}.
738
 */
739
function password_change ($id, $passwd)
740
{
741
    debug_write_log(DEBUG_TRACE, '[password_change]');
742
    debug_write_log(DEBUG_DUMP,  '[password_change] $id = ' . $id);
743
744
    dal_query('accounts/passwd.sql',
745
              $id,
746
              base64_encode(sha1($passwd, TRUE)),
747
              time());
748
749
    return NO_ERROR;
750
}
751
752
/**
753
 * Change UI language for specified user.

src/dbo/records.php 1 location

@@ 1636-1647 (lines=12) @@
1633
 * @param int $id ID of record to be marked as unread.
1634
 * @return int Always {@link NO_ERROR}.
1635
 */
1636
function record_unread ($id)
1637
{
1638
    debug_write_log(DEBUG_TRACE, '[record_unread]');
1639
    debug_write_log(DEBUG_DUMP,  '[record_unread] $id = ' . $id);
1640
1641
    if (get_user_level() != USER_LEVEL_GUEST)
1642
    {
1643
        dal_query('records/unread.sql', $id, $_SESSION[VAR_USERID]);
1644
    }
1645
1646
    return NO_ERROR;
1647
}
1648
1649
/**
1650
 * Change state of specified record.