*
 *    "PCPIN Chat 6" is free software; you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation; either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    "PCPIN Chat 6" is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
_pcpin_loadClass('disallowed_name');
$disallowed_name = new PCPIN_Disallowed_Name($session);
$errortext = array();
if (!isset($name)) {
    $name = '';
}
if (!empty($current_user->id) && $current_user->is_admin === 'y') {
    if ($name == '') {
        $errortext[] = $l->g('name_empty_error');
    }
    if ($disallowed_name->_db_getList('name = ' . $name, 1)) {
        $errortext[] = str_replace('[NAME]', $name, $l->g('name_already_exists_error'));
        $disallowed_name->_db_freeList();
    }
    if (empty($errortext)) {
        // Save word
        if ($disallowed_name->addName($name)) {
 *    "PCPIN Chat 6" is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
_pcpin_loadClass('nickname');
$nickname = new PCPIN_Nickname($session);
_pcpin_loadClass('message');
$msg = new PCPIN_Message($session);
_pcpin_loadClass('badword');
$badword = new PCPIN_Badword($session);
_pcpin_loadClass('disallowed_name');
$disallowed_name = new PCPIN_Disallowed_Name($session);
$nicknames_xml = array();
$new_nickname_id = 0;
if (empty($profile_user_id) || $profile_user_id != $current_user->id && $current_user->is_admin !== 'y') {
    $profile_user_id = $current_user->id;
}
if (!isset($nickname_id) || !is_scalar($nickname_id)) {
    $nickname_id = 0;
}
if (!isset($new_nickname) || !is_scalar($new_nickname)) {
    $new_nickname = '';
}
if (!empty($nickname_id) && !$nickname->_db_getList('id', 'id = ' . $nickname_id, 'user_id = ' . $profile_user_id, 1)) {
    // Nickname does not exists or not belongs to user
    $nickname_id = 0;
}
 *
 *    "PCPIN Chat 6" is free software; you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation; either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    "PCPIN Chat 6" is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
_pcpin_loadClass('disallowed_name');
$disallowed_name = new PCPIN_Disallowed_Name($session);
if (!isset($name_id)) {
    $name_id = 0;
}
if (!empty($current_user->id) && $current_user->is_admin === 'y') {
    if (!empty($name_id)) {
        // Delete name
        if ($disallowed_name->deleteName($name_id)) {
            $xmlwriter->setHeaderStatus(0);
            $xmlwriter->setHeaderMessage($l->g('name_deleted'));
        } else {
            $xmlwriter->setHeaderStatus(1);
            $xmlwriter->setHeaderMessage($l->g('error'));
        }
    }
}
<?php

/**
 *    This file is part of "PCPIN Chat 6".
 *
 *    "PCPIN Chat 6" is free software; you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation; either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    "PCPIN Chat 6" is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
/**
* Get word blacklist
*/
_pcpin_loadClass('disallowed_name');
$disallowed_name = new PCPIN_Disallowed_Name($session);
$names = array();
if (!empty($current_user->id) && $current_user->is_admin === 'y') {
    $xmlwriter->setHeaderMessage('OK');
    $xmlwriter->setHeaderStatus(0);
    $names = $disallowed_name->getDisallowedNames();
}
$xmlwriter->setData(array('name' => $names));
 *    the Free Software Foundation; either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    "PCPIN Chat 6" is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
if ($session->_conf_all['allow_user_registration']) {
    _pcpin_loadClass('badword');
    $badword = new PCPIN_Badword($session);
    _pcpin_loadClass('disallowed_name');
    $disallowed_name = new PCPIN_Disallowed_Name($session);
    if (!isset($login) || !is_scalar($login)) {
        $login = '';
    }
    if (!isset($password) || !is_scalar($password)) {
        $password = '';
    }
    if (!isset($email) || !is_scalar($email)) {
        $email = '';
    }
    if (!isset($language_id) || !is_scalar($language_id)) {
        $language_id = $l->id;
    }
    // Load language
    if ($language_id != $l->id) {
        $old_language_id = $l->id;