コード例 #1
0
$g_vars['page']['userfield6_content'] = getSelectElement('userfield6', getConfigItem(CONFIG_reg_userfield6), array(CONFIG_CONST_donotshow => $lngstr['page_config']['donotshow'], CONFIG_CONST_show_donotrequire => $lngstr['page_config']['show_donotrequire'], CONFIG_CONST_show_require => $lngstr['page_config']['show_require']));
$g_vars['page']['userfield6_type_label'] = sprintf($lngstr['label_userfield_type'], 6);
$g_vars['page']['userfield6_type_content'] = getSelectElement('type_userfield6', getConfigItem(CONFIG_reg_type_userfield6), $lngstr['label_userfield_type_items'], ' onchange="showDIV(\'div_config_values_userfield6\', this.selectedIndex==' . CONFIG_CONST_type_dropdownlist . ', false);"') . '<br><div id=div_config_values_userfield6 style="display:' . (getConfigItem(CONFIG_reg_type_userfield6) == CONFIG_CONST_type_dropdownlist ? 'block' : 'none') . '">' . getInputElement('values_userfield6', getConfigItem(CONFIG_reg_values_userfield6)) . ' ' . $lngstr['label_userfield_values_hint'] . '</div>';
$g_vars['page']['userfield6_caption_label'] = sprintf($lngstr['label_userfield_caption'], 6);
$g_vars['page']['userfield6_caption_content'] = getInputElement('caption_userfield6', getConfigItem(CONFIG_reg_caption_userfield6));
$g_vars['page']['userfield7_label'] = sprintf($lngstr['label_userfield'], 7);
$g_vars['page']['userfield7_content'] = getSelectElement('userfield7', getConfigItem(CONFIG_reg_userfield7), array(CONFIG_CONST_donotshow => $lngstr['page_config']['donotshow'], CONFIG_CONST_show_donotrequire => $lngstr['page_config']['show_donotrequire'], CONFIG_CONST_show_require => $lngstr['page_config']['show_require']));
$g_vars['page']['userfield7_type_label'] = sprintf($lngstr['label_userfield_type'], 7);
$g_vars['page']['userfield7_type_content'] = getSelectElement('type_userfield7', getConfigItem(CONFIG_reg_type_userfield7), $lngstr['label_userfield_type_items'], ' onchange="showDIV(\'div_config_values_userfield7\', this.selectedIndex==' . CONFIG_CONST_type_dropdownlist . ', false);"') . '<br><div id=div_config_values_userfield7 style="display:' . (getConfigItem(CONFIG_reg_type_userfield7) == CONFIG_CONST_type_dropdownlist ? 'block' : 'none') . '">' . getInputElement('values_userfield7', getConfigItem(CONFIG_reg_values_userfield7)) . ' ' . $lngstr['label_userfield_values_hint'] . '</div>';
$g_vars['page']['userfield7_caption_label'] = sprintf($lngstr['label_userfield_caption'], 7);
$g_vars['page']['userfield7_caption_content'] = getInputElement('caption_userfield7', getConfigItem(CONFIG_reg_caption_userfield7));
$g_vars['page']['userfield8_label'] = sprintf($lngstr['label_userfield'], 8);
$g_vars['page']['userfield8_content'] = getSelectElement('userfield8', getConfigItem(CONFIG_reg_userfield8), array(CONFIG_CONST_donotshow => $lngstr['page_config']['donotshow'], CONFIG_CONST_show_donotrequire => $lngstr['page_config']['show_donotrequire'], CONFIG_CONST_show_require => $lngstr['page_config']['show_require']));
$g_vars['page']['userfield8_type_label'] = sprintf($lngstr['label_userfield_type'], 8);
$g_vars['page']['userfield8_type_content'] = getSelectElement('type_userfield8', getConfigItem(CONFIG_reg_type_userfield8), $lngstr['label_userfield_type_items'], ' onchange="showDIV(\'div_config_values_userfield8\', this.selectedIndex==' . CONFIG_CONST_type_dropdownlist . ', false);"') . '<br><div id=div_config_values_userfield8 style="display:' . (getConfigItem(CONFIG_reg_type_userfield8) == CONFIG_CONST_type_dropdownlist ? 'block' : 'none') . '">' . getInputElement('values_userfield8', getConfigItem(CONFIG_reg_values_userfield8)) . ' ' . $lngstr['label_userfield_values_hint'] . '</div>';
$g_vars['page']['userfield8_caption_label'] = sprintf($lngstr['label_userfield_caption'], 8);
$g_vars['page']['userfield8_caption_content'] = getInputElement('caption_userfield8', getConfigItem(CONFIG_reg_caption_userfield8));
$g_vars['page']['userfield9_label'] = sprintf($lngstr['label_userfield'], 9);
$g_vars['page']['userfield9_content'] = getSelectElement('userfield9', getConfigItem(CONFIG_reg_userfield9), array(CONFIG_CONST_donotshow => $lngstr['page_config']['donotshow'], CONFIG_CONST_show_donotrequire => $lngstr['page_config']['show_donotrequire'], CONFIG_CONST_show_require => $lngstr['page_config']['show_require']));
$g_vars['page']['userfield9_type_label'] = sprintf($lngstr['label_userfield_type'], 9);
$g_vars['page']['userfield9_type_content'] = getSelectElement('type_userfield9', getConfigItem(CONFIG_reg_type_userfield9), $lngstr['label_userfield_type_items'], ' onchange="showDIV(\'div_config_values_userfield9\', this.selectedIndex==' . CONFIG_CONST_type_dropdownlist . ', false);"') . '<br><div id=div_config_values_userfield9 style="display:' . (getConfigItem(CONFIG_reg_type_userfield9) == CONFIG_CONST_type_dropdownlist ? 'block' : 'none') . '">' . getInputElement('values_userfield9', getConfigItem(CONFIG_reg_values_userfield9)) . ' ' . $lngstr['label_userfield_values_hint'] . '</div>';
$g_vars['page']['userfield9_caption_label'] = sprintf($lngstr['label_userfield_caption'], 9);
$g_vars['page']['userfield9_caption_content'] = getInputElement('caption_userfield9', getConfigItem(CONFIG_reg_caption_userfield9));
$g_vars['page']['userfield10_label'] = sprintf($lngstr['label_userfield'], 10);
$g_vars['page']['userfield10_content'] = getSelectElement('userfield10', getConfigItem(CONFIG_reg_userfield10), array(CONFIG_CONST_donotshow => $lngstr['page_config']['donotshow'], CONFIG_CONST_show_donotrequire => $lngstr['page_config']['show_donotrequire'], CONFIG_CONST_show_require => $lngstr['page_config']['show_require']));
$g_vars['page']['userfield10_type_label'] = sprintf($lngstr['label_userfield_type'], 10);
$g_vars['page']['userfield10_type_content'] = getSelectElement('type_userfield10', getConfigItem(CONFIG_reg_type_userfield10), $lngstr['label_userfield_type_items'], ' onchange="showDIV(\'div_config_values_userfield10\', this.selectedIndex==' . CONFIG_CONST_type_dropdownlist . ', false);"') . '<br><div id=div_config_values_userfield10 style="display:' . (getConfigItem(CONFIG_reg_type_userfield10) == CONFIG_CONST_type_dropdownlist ? 'block' : 'none') . '">' . getInputElement('values_userfield10', getConfigItem(CONFIG_reg_values_userfield10)) . ' ' . $lngstr['label_userfield_values_hint'] . '</div>';
$g_vars['page']['userfield10_caption_label'] = sprintf($lngstr['label_userfield_caption'], 10);
$g_vars['page']['userfield10_caption_content'] = getInputElement('caption_userfield10', getConfigItem(CONFIG_reg_caption_userfield10));
$g_smarty->assign('g_vars', $g_vars);
displayTemplate('config-main');
コード例 #2
0
reset($lngstr['language']['locale']);
$i_locale_set = false;
while (!$i_locale_set && (list(, $val) = each($lngstr['language']['locale']))) {
    $i_locale_set = setlocale(LC_ALL, $val);
}
if (ini_get('magic_quotes_runtime') == 1) {
    set_magic_quotes_runtime(0);
}
if (!isset($G_SESSION['config_itemsperpage'])) {
    $G_SESSION['config_itemsperpage'] = getConfigItem(CONFIG_list_length);
    if (!$G_SESSION['config_itemsperpage']) {
        $G_SESSION['config_itemsperpage'] = 30;
    }
}
if (!isset($G_SESSION['config_editortype'])) {
    $G_SESSION['config_editortype'] = getConfigItem(CONFIG_editor_type);
    if (!$G_SESSION['config_editortype']) {
        $G_SESSION['config_editortype'] = 2;
    }
}
if (!isset($srv_settings['url_root_full'])) {
    $srv_settings['url_root_full'] = dirname(getFullScriptURL());
}
$g_vars['page']['title'] = '';
$g_vars['page']['meta'] = '';
$g_vars['page']['body_tag'] = '';
$g_vars['page']['hide_cpanel'] = false;
$g_vars['page']['location'] = array();
$g_vars['page']['errors'] = '';
$g_vars['page']['errors_fatal'] = false;
$g_vars['page']['notifications'] = '';
コード例 #3
0
    $g_db->debug = false;
}
$g_vars['page']['title'] = $lngstr['install_db_title'];
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="' . $lngstr['text_direction'] . '"><head><title>' . $g_vars['page']['title'] . '</title>
<meta http-equiv="Content-Language" content="' . $lngstr['meta_contentlanguage'] . '">
<meta content="text/html; charset=' . $lngstr['meta_charset'] . '" http-equiv=Content-Type>
<link rel="SHORTCUT ICON" href="favicon.ico">
<link href="shared/style.css" rel=stylesheet type=text/css>
<script language=javascript src="shared/shared.js" type="text/javascript"></script>
</head>
<body bgcolor="#ffffff"><form name="installForm" method="post" action="">
<table style="height: 98%; border: 1px solid #CFD6E3;" cellpadding=0 cellspacing=25 border=0 width="780" height="100%" align=center>
<tr height="100%" vAlign=top><td><img src="images/logo.gif" width=200 height=40><br>';
echo '<h1>' . $lngstr['install_db_page1'] . '</h1>';
switch (getConfigItem(CONFIG_igttimestamp)) {
    case NULL:
        $i_rSet1 = $g_db->SelectLimit("SELECT " . $srv_settings['table_prefix'] . "etemplateid FROM etemplates", 1);
        if ($i_rSet1 && !$i_rSet1->EOF) {
            doQueryQueue($i_queries_010009);
            $i_rSet1->Close();
        } else {
            doQueryQueue($i_queries_new);
            doQueryQueue($arrInstallQueriesSpecial['after_any']);
            echo '<p align=center>' . $lngstr['initdb_instructions'] . '</p>';
            break;
        }
    case 1117883274:
    case 1118316098:
        doQueryQueue($i_queries_010202);
    case 1120392865:
コード例 #4
0
if (getConfigItem(CONFIG_reg_userfield7) > CONFIG_CONST_donotshow) {
    if (isset($_POST['user_ufield7'])) {
        $arrValuesToUpdate['user_ufield7'] = readPostVar('user_ufield7');
    }
}
if (getConfigItem(CONFIG_reg_userfield8) > CONFIG_CONST_donotshow) {
    if (isset($_POST['user_ufield8'])) {
        $arrValuesToUpdate['user_ufield8'] = readPostVar('user_ufield8');
    }
}
if (getConfigItem(CONFIG_reg_userfield9) > CONFIG_CONST_donotshow) {
    if (isset($_POST['user_ufield9'])) {
        $arrValuesToUpdate['user_ufield9'] = readPostVar('user_ufield9');
    }
}
if (getConfigItem(CONFIG_reg_userfield10) > CONFIG_CONST_donotshow) {
    if (isset($_POST['user_ufield10'])) {
        $arrValuesToUpdate['user_ufield10'] = readPostVar('user_ufield10');
    }
}
if (isset($_POST['user_notes'])) {
    $arrValuesToUpdate['user_notes'] = readPostVar('user_notes');
}
$bIsUserNameDuplicated = getRecordCount($srv_settings['table_prefix'] . 'users', 'username='******'username'] . (!$bIsNewUser ? ' AND id<>' . $arrValuesToUpdate['id'] : '')) > 0;
if ($bIsUserNameDuplicated) {
    $g_vars['page']['errors'] .= $lngstr['err_username_duplicate'];
}
if ($g_vars['page']['errors']) {
    include_once $DOCUMENT_PAGES . "manageusers-2.inc.php";
} else {
    if ($bIsNewUser) {
コード例 #5
0
ファイル: config.php プロジェクト: Nolfneo/docvert
function getGlobalConfigItem($key)
{
    return getConfigItem(getGlobalConfigPath(), $key);
}
コード例 #6
0
<?php

require_once "inc/init.inc.php";
$g_vars['page']['title'] = $lngstr['page_title_register'];
if (getConfigItem(CONFIG_can_register)) {
    switch (readGetVar('action')) {
        case 'step2':
            if (isset($_POST['bsubmit'])) {
                include_once $DOCUMENT_PAGES . "register-step-2-submit.inc.php";
            } else {
                include_once $DOCUMENT_PAGES . "register-step-2.inc.php";
            }
            break;
        default:
            if (isset($_POST['bsubmit'])) {
                include_once $DOCUMENT_PAGES . "register-2.inc.php";
            } else {
                include_once $DOCUMENT_PAGES . "register-1.inc.php";
            }
    }
} else {
    $g_vars['page']['title'] = $lngstr['page_title_signin'];
    $g_vars['page']['errors'] = $lngstr['err_no_permissions_to_register'];
    include_once $DOCUMENT_PAGES . "signin-1.inc.php";
}
コード例 #7
0
    $i_userfield9_items = array();
    $i_items = explode(',', getConfigItem(CONFIG_reg_values_userfield9));
    foreach ($i_items as $val) {
        $i_userfield9_items[$val] = $val;
    }
}
if (getConfigItem(CONFIG_reg_userfield9) > CONFIG_CONST_donotshow) {
    writeTR2Fixed(getConfigItem(CONFIG_reg_caption_userfield9) . ':', getConfigItem(CONFIG_reg_type_userfield9) == CONFIG_CONST_type_singlelinetext ? getInputElement('user_ufield9', @$arrUserData['user_ufield9']) : (getConfigItem(CONFIG_reg_type_userfield9) == CONFIG_CONST_type_multilinetext ? getTextArea('user_ufield9', @$arrUserData['user_ufield9']) : getSelectElement('user_ufield9', @$arrUserData['user_ufield9'], $i_userfield9_items)));
}
if (isset($lngstr['custom']['user_userfield10_items'])) {
    $i_userfield10_items = $lngstr['custom']['user_userfield10_items'];
} else {
    $i_userfield10_items = array();
    $i_items = explode(',', getConfigItem(CONFIG_reg_values_userfield10));
    foreach ($i_items as $val) {
        $i_userfield10_items[$val] = $val;
    }
}
if (getConfigItem(CONFIG_reg_userfield10) > CONFIG_CONST_donotshow) {
    writeTR2Fixed(getConfigItem(CONFIG_reg_caption_userfield10) . ':', getConfigItem(CONFIG_reg_type_userfield10) == CONFIG_CONST_type_singlelinetext ? getInputElement('user_ufield10', @$arrUserData['user_ufield10']) : (getConfigItem(CONFIG_reg_type_userfield10) == CONFIG_CONST_type_multilinetext ? getTextArea('user_ufield10', @$arrUserData['user_ufield10']) : getSelectElement('user_ufield10', @$arrUserData['user_ufield10'], $i_userfield10_items)));
}
echo '</table></div></td></tr>';
if ($G_SESSION['access_users'] != 1 && $G_SESSION['access_users'] != 3) {
    echo '<tr valign=top><td class=rowhdr2 colspan=2><a class=rowhdr2 href="javascript:void(0)" onclick="javascript:toggleSection(\'div_users_notes\')">' . $lngstr['page_users']['section_notes'] . '</td></tr>';
    echo '<tr valign=top><td class=rowone colspan=2><div id=div_users_notes style="display:' . (isset($_COOKIE['div_users_notes']) && $_COOKIE['div_users_notes'] == 'Y' ? 'block' : 'none') . '"><table class=rowtable2 cellpadding=5 cellspacing=1 border=0 width="100%">';
    writeTR2Fixed($lngstr['page_users']['notes'], getTextArea('user_notes', @$arrUserData['user_notes']));
    echo '</table></div></td></tr>';
}
echo '</table>';
echo '<p class=center><input class=btn type=submit name=bsubmit value=" ' . $lngstr['button_update'] . ' "> <input class=btn type=submit name=bcancel value=" ' . $lngstr['button_cancel'] . ' "></form>';
displayTemplate('_footer');
コード例 #8
0
<?php

$i_list_length = (int) readPostVar('list_length');
if ($i_list_length <= 0) {
    $i_list_length = 10;
}
setConfigItem(CONFIG_list_length, $i_list_length);
$G_SESSION['config_itemsperpage'] = getConfigItem(CONFIG_list_length);
setConfigItem(CONFIG_editor_type, (int) readPostVar('editor_type'));
$G_SESSION['config_editortype'] = getConfigItem(CONFIG_editor_type);
setConfigItem(CONFIG_store_logs, (int) readPostVar('store_logs'));
$G_SESSION['config_storesessionlogs'] = getConfigItem(CONFIG_store_logs) ? true : false;
setConfigItem(CONFIG_can_register, (int) readPostVar('can_register'));
setConfigItem(CONFIG_upon_registration, (int) readPostVar('upon_registration'));
setConfigItem(CONFIG_reg_intro, readPostVar('reg_intro'));
setConfigItem(CONFIG_reg_username, (int) readPostVar('username'));
setConfigItem(CONFIG_reg_password, (int) readPostVar('password'));
setConfigItem(CONFIG_reg_email, (int) readPostVar('email'));
setConfigItem(CONFIG_reg_title, (int) readPostVar('title'));
setConfigItem(CONFIG_reg_firstname, (int) readPostVar('firstname'));
setConfigItem(CONFIG_reg_lastname, (int) readPostVar('lastname'));
setConfigItem(CONFIG_reg_middlename, (int) readPostVar('middlename'));
setConfigItem(CONFIG_reg_address, (int) readPostVar('address'));
setConfigItem(CONFIG_reg_city, (int) readPostVar('city'));
setConfigItem(CONFIG_reg_state, (int) readPostVar('state'));
setConfigItem(CONFIG_reg_zip, (int) readPostVar('zip'));
setConfigItem(CONFIG_reg_country, (int) readPostVar('country'));
setConfigItem(CONFIG_reg_phone, (int) readPostVar('phone'));
setConfigItem(CONFIG_reg_fax, (int) readPostVar('fax'));
setConfigItem(CONFIG_reg_mobile, (int) readPostVar('mobile'));
setConfigItem(CONFIG_reg_pager, (int) readPostVar('pager'));
コード例 #9
0
<?php

defined('IGT_VALID_ENVIRONMENT') or exit('Restricted access');
$g_vars['page']['hide_cpanel'] = true;
$f_username = readPostVar('username');
$g_vars['page']['username'] = convertTextValue($f_username);
$g_vars['page']['gotourl'] = @htmlspecialchars($_SERVER['REQUEST_URI']);
$g_vars['page']['cansigninasguest'] = getRecordCount($srv_settings['table_prefix'] . 'users', 'id=' . SYSTEM_GROUP_GUEST_id . ' AND user_enabled=1') > 0;
$g_vars['page']['test_code'] = isset($G_SESSION['test_code']) ? $G_SESSION['test_code'] : '';
$g_vars['page']['can_register'] = getConfigItem(CONFIG_can_register);
eventOnBeforePageGeneration(array('page_name' => 'signin'));
$g_smarty->assign('g_vars', $g_vars);
displayTemplate('signin');
コード例 #10
0
<?php

$f_username = readPostVar('username', readGetVar('username'));
$f_password = readPostVar('password', readGetVar('password'));
$f_bguest = isset($_POST['bguest']) || isset($_GET['bguest']);
$G_SESSION['test_code'] = readPostVar('test_code');
if (signinUser($f_username, $f_password, $f_bguest)) {
    $i_gotourl = isset($_POST['gotourl']) && strpos($_POST['gotourl'], '/register.php') === false && strpos($_POST['gotourl'], '/lostpassword.php') === false && strpos($_POST['gotourl'], '/account.php') === false && strpos($_POST['gotourl'], '/signin.php') === false ? $_POST['gotourl'] : 'index.php';
    gotoLocation($i_gotourl);
} else {
    if (empty($f_username) && empty($f_password) && getConfigItem(CONFIG_can_register)) {
        gotoLocation('register.php');
    } else {
        $g_vars['page']['title'] = $lngstr['page_title_signin'];
        $g_vars['page']['errors'] = $lngstr['err_signin_incorrect'];
        include_once $DOCUMENT_PAGES . 'signin-1.inc.php';
    }
}
コード例 #11
0
if (isset($lngstr['custom']['user_userfield9_items'])) {
    $i_userfield9_items = $lngstr['custom']['user_userfield9_items'];
} else {
    $i_userfield9_items = array();
    $i_items = explode(',', getConfigItem(CONFIG_reg_values_userfield9));
    foreach ($i_items as $val) {
        $i_userfield9_items[$val] = $val;
    }
}
$g_vars['page']['items']['userfield9'] = @getInputField(getConfigItem(CONFIG_reg_userfield9), getConfigItem(CONFIG_reg_caption_userfield9) . ':', getConfigItem(CONFIG_reg_type_userfield9) == CONFIG_CONST_type_singlelinetext ? getInputElement('userfield9', $f_userfield9) : (getConfigItem(CONFIG_reg_type_userfield9) == CONFIG_CONST_type_multilinetext ? getTextArea('userfield9', $f_userfield9) : getSelectElement('userfield9', $f_userfield9, $i_userfield9_items)));
if (isset($lngstr['custom']['user_userfield10_items'])) {
    $i_userfield10_items = $lngstr['custom']['user_userfield10_items'];
} else {
    $i_userfield10_items = array();
    $i_items = explode(',', getConfigItem(CONFIG_reg_values_userfield10));
    foreach ($i_items as $val) {
        $i_userfield10_items[$val] = $val;
    }
}
$g_vars['page']['items']['userfield10'] = @getInputField(getConfigItem(CONFIG_reg_userfield10), getConfigItem(CONFIG_reg_caption_userfield10) . ':', getConfigItem(CONFIG_reg_type_userfield10) == CONFIG_CONST_type_singlelinetext ? getInputElement('userfield10', $f_userfield10) : (getConfigItem(CONFIG_reg_type_userfield10) == CONFIG_CONST_type_multilinetext ? getTextArea('userfield10', $f_userfield10) : getSelectElement('userfield10', $f_userfield10, $i_userfield10_items)));
function getInputField($i_showsettings, $i_caption, $i_value)
{
    if ($i_showsettings >= CONFIG_CONST_show_donotrequire) {
        return getTR(array($i_caption . ' ' . ($i_showsettings >= CONFIG_CONST_show_autogenerate ? REQUIRED_FIELD_MARK : ''), $i_value));
    }
    return '';
}
$g_vars['page']['items']['groupid_input'] = getInputElement('groupid', $f_groupid, 0, 0, '', $i_type = 'hidden');
$g_vars['page']['items']['testid_input'] = getInputElement('testid', $f_testid, 0, 0, '', $i_type = 'hidden');
$g_smarty->assign('g_vars', $g_vars);
displayTemplate('register');
コード例 #12
0
function addNewUser($arrUserData = array(), $arrGroupIDs = array(), $bForceCreation = false)
{
    global $g_db, $srv_settings;
    if (!isset($arrUserData['user_password'])) {
        $arrUserData['user_password'] = '';
    }
    if (!isset($arrUserData['user_passhash'])) {
        $arrUserData['user_passhash'] = md5($arrUserData['user_password']);
    }
    unset($arrUserData['user_password']);
    if (!isset($arrUserData['user_checkword'])) {
        $arrUserData['user_checkword'] = getAutoPassword(IGT_CHECKWORD_LENGTH);
    }
    if (!isset($arrUserData['user_joindate'])) {
        $arrUserData['user_joindate'] = time();
    }
    if (!isset($arrUserData['user_logindate'])) {
        $arrUserData['user_logindate'] = 0;
    }
    if (!isset($arrUserData['user_address'])) {
        $arrUserData['user_address'] = '';
    }
    if (!isset($arrUserData['user_caddress'])) {
        $arrUserData['user_caddress'] = '';
    }
    if (!isset($arrUserData['user_ufield1'])) {
        $arrUserData['user_ufield1'] = '';
    }
    if (!isset($arrUserData['user_ufield2'])) {
        $arrUserData['user_ufield2'] = '';
    }
    if (!isset($arrUserData['user_ufield3'])) {
        $arrUserData['user_ufield3'] = '';
    }
    if (!isset($arrUserData['user_ufield4'])) {
        $arrUserData['user_ufield4'] = '';
    }
    if (!isset($arrUserData['user_ufield5'])) {
        $arrUserData['user_ufield5'] = '';
    }
    if (!isset($arrUserData['user_ufield6'])) {
        $arrUserData['user_ufield6'] = '';
    }
    if (!isset($arrUserData['user_ufield7'])) {
        $arrUserData['user_ufield7'] = '';
    }
    if (!isset($arrUserData['user_ufield8'])) {
        $arrUserData['user_ufield8'] = '';
    }
    if (!isset($arrUserData['user_ufield9'])) {
        $arrUserData['user_ufield9'] = '';
    }
    if (!isset($arrUserData['user_ufield10'])) {
        $arrUserData['user_ufield10'] = '';
    }
    if (!isset($arrUserData['user_notes'])) {
        $arrUserData['user_notes'] = '';
    }
    $i_names = '';
    $i_values = '';
    foreach ($arrUserData as $name => $value) {
        if (strlen($i_names) > 0) {
            $i_names .= ',';
            $i_values .= ',';
        }
        $i_names .= $name;
        $i_values .= $g_db->qstr($value, get_magic_quotes_gpc());
    }
    if (!$bForceCreation && getConfigItem(CONFIG_reg_username) == CONFIG_CONST_show_require) {
        $i_duplicates = getRecordCount($srv_settings['table_prefix'] . 'users', "username=" . $g_db->qstr($arrUserData['username'], get_magic_quotes_gpc()));
    } else {
        $i_duplicates = 0;
    }
    if ($i_duplicates <= 0) {
        $qry_str = 'INSERT INTO ' . $srv_settings['table_prefix'] . 'users (' . $i_names . ') VALUES (' . $i_values . ')';
        if ($g_db->Execute($qry_str) === false) {
            showDBError('addNewUser', 1);
        }
        $i_id = (int) $g_db->Insert_ID($srv_settings['table_prefix'] . 'users', 'id');
        manageUserGroups(array($i_id), $arrGroupIDs, true);
        return $i_id;
    } else {
        return false;
    }
}
コード例 #13
0
 $i_id = api_addNewUser($f_username, $f_password, array('email' => $f_email, 'title' => $f_title, 'firstname' => $f_firstname, 'lastname' => $f_lastname, 'middlename' => $f_middlename, 'address' => $f_address, 'city' => $f_city, 'state' => $f_state, 'zip' => $f_zip, 'country' => $f_country, 'phone' => $f_phone, 'fax' => $f_fax, 'mobile' => $f_mobile, 'pager' => $f_pager, 'ipphone' => $f_ipphone, 'webpage' => $f_webpage, 'icq' => $f_icq, 'msn' => $f_msn, 'aol' => $f_aol, 'gender' => $f_gender, 'birthday' => $f_birthday, 'husbandwife' => $f_husbandwife, 'children' => $f_children, 'trainer' => $f_trainer, 'photo' => $f_photo, 'company' => $f_company, 'cposition' => $f_cposition, 'department' => $f_department, 'coffice' => $f_coffice, 'caddress' => $f_caddress, 'ccity' => $f_ccity, 'cstate' => $f_cstate, 'czip' => $f_czip, 'ccountry' => $f_ccountry, 'cphone' => $f_cphone, 'cfax' => $f_cfax, 'cmobile' => $f_cmobile, 'cpager' => $f_cpager, 'cipphone' => $f_cipphone, 'cwebpage' => $f_cwebpage, 'cphoto' => $f_cphoto, 'ufield1' => $f_userfield1, 'ufield2' => $f_userfield2, 'ufield3' => $f_userfield3, 'ufield4' => $f_userfield4, 'ufield5' => $f_userfield5, 'ufield6' => $f_userfield6, 'ufield7' => $f_userfield7, 'ufield8' => $f_userfield8, 'ufield9' => $f_userfield9, 'ufield10' => $f_userfield10, 'checkword' => $i_checkword, 'active' => false), array($f_groupid));
 if ($i_id == false) {
     $g_vars['page']['errors'] .= $lngstr['err_username_duplicate'];
     unset($f_username);
     include_once $DOCUMENT_PAGES . "register-1.inc.php";
 } else {
     if ($i_CONFIG_reg_username == CONFIG_CONST_donotshow_autogenerate || $i_CONFIG_reg_username == CONFIG_CONST_show_autogenerate && getRecordCount($srv_settings['table_prefix'] . 'users', "username="******"UPDATE " . $srv_settings['table_prefix'] . "users SET username="******" WHERE id=" . $i_id);
         $_POST['username'] = $f_username;
     }
     sendEmailTemplate(array('etemplateid' => SYSTEM_ETEMPLATES_REGISTRATION_INDEX, 'emailto' => array($f_email), 'id' => $i_id, 'username' => $f_username, 'password' => $f_password, 'email' => $f_email, 'title' => $f_title, 'firstname' => $f_firstname, 'lastname' => $f_lastname, 'middlename' => $f_middlename, 'address' => $f_address, 'city' => $f_city, 'state' => $f_state, 'zip' => $f_zip, 'country' => $f_country, 'phone' => $f_phone, 'fax' => $f_fax, 'mobile' => $f_mobile, 'pager' => $f_pager, 'ipphone' => $f_ipphone, 'webpage' => $f_webpage, 'icq' => $f_icq, 'msn' => $f_msn, 'aol' => $f_aol, 'gender' => $f_gender, 'birthday' => $f_birthday, 'husbandwife' => $f_husbandwife, 'children' => $f_children, 'trainer' => $f_trainer, 'photo' => $f_photo, 'company' => $f_company, 'cposition' => $f_cposition, 'department' => $f_department, 'coffice' => $f_coffice, 'caddress' => $f_caddress, 'ccity' => $f_ccity, 'cstate' => $f_cstate, 'czip' => $f_czip, 'ccountry' => $f_ccountry, 'cphone' => $f_cphone, 'cfax' => $f_cfax, 'cmobile' => $f_cmobile, 'cpager' => $f_cpager, 'cipphone' => $f_cipphone, 'cwebpage' => $f_cwebpage, 'cphoto' => $f_cphoto, 'ufield1' => $f_userfield1, 'ufield2' => $f_userfield2, 'ufield3' => $f_userfield3, 'ufield4' => $f_userfield4, 'ufield5' => $f_userfield5, 'ufield6' => $f_userfield6, 'ufield7' => $f_userfield7, 'ufield8' => $f_userfield8, 'ufield9' => $f_userfield9, 'ufield10' => $f_userfield10, 'checkword' => $i_checkword));
     $i_admin_emails = getRecordItem($srv_settings['table_prefix'] . 'etemplates', 'etemplate_from', 'etemplateid=' . SYSTEM_ETEMPLATES_ACTIVATE_INDEX);
     $i_admin_emails = explode(SYSTEM_ARRAY_ITEM_SEPARATOR, $i_admin_emails);
     sendEmailTemplate(array('etemplateid' => SYSTEM_ETEMPLATES_REGISTRATION_INDEX_FOR_ADMIN, 'emailto' => $i_admin_emails, 'id' => $i_id, 'username' => $f_username, 'password' => $f_password, 'email' => $f_email, 'title' => $f_title, 'firstname' => $f_firstname, 'lastname' => $f_lastname, 'middlename' => $f_middlename, 'address' => $f_address, 'city' => $f_city, 'state' => $f_state, 'zip' => $f_zip, 'country' => $f_country, 'phone' => $f_phone, 'fax' => $f_fax, 'mobile' => $f_mobile, 'pager' => $f_pager, 'ipphone' => $f_ipphone, 'webpage' => $f_webpage, 'icq' => $f_icq, 'msn' => $f_msn, 'aol' => $f_aol, 'gender' => $f_gender, 'birthday' => $f_birthday, 'husbandwife' => $f_husbandwife, 'children' => $f_children, 'trainer' => $f_trainer, 'photo' => $f_photo, 'company' => $f_company, 'cposition' => $f_cposition, 'department' => $f_department, 'coffice' => $f_coffice, 'caddress' => $f_caddress, 'ccity' => $f_ccity, 'cstate' => $f_cstate, 'czip' => $f_czip, 'ccountry' => $f_ccountry, 'cphone' => $f_cphone, 'cfax' => $f_cfax, 'cmobile' => $f_cmobile, 'cpager' => $f_cpager, 'cipphone' => $f_cipphone, 'cwebpage' => $f_cwebpage, 'cphoto' => $f_cphoto, 'ufield1' => $f_userfield1, 'ufield2' => $f_userfield2, 'ufield3' => $f_userfield3, 'ufield4' => $f_userfield4, 'ufield5' => $f_userfield5, 'ufield6' => $f_userfield6, 'ufield7' => $f_userfield7, 'ufield8' => $f_userfield8, 'ufield9' => $f_userfield9, 'ufield10' => $f_userfield10, 'checkword' => $i_checkword));
     switch (getConfigItem(CONFIG_upon_registration)) {
         case CONFIG_CONST_upon_registration_signinautomatically:
             activateUserByID($i_id, true);
             signinUser($f_username, $f_password, false);
             if ($f_testid > 0) {
                 gotoLocation('test.php?testid=' . $f_testid);
             } else {
                 gotoLocation('index.php');
             }
             break;
         case CONFIG_CONST_upon_registration_sendactivationemailtouser:
             sendEmailTemplate(array('etemplateid' => SYSTEM_ETEMPLATES_ACTIVATE_INDEX, 'emailto' => array($f_email), 'id' => $i_id, 'username' => $f_username, 'password' => $f_password, 'email' => $f_email, 'title' => $f_title, 'firstname' => $f_firstname, 'lastname' => $f_lastname, 'middlename' => $f_middlename, 'address' => $f_address, 'city' => $f_city, 'state' => $f_state, 'zip' => $f_zip, 'country' => $f_country, 'phone' => $f_phone, 'fax' => $f_fax, 'mobile' => $f_mobile, 'pager' => $f_pager, 'ipphone' => $f_ipphone, 'webpage' => $f_webpage, 'icq' => $f_icq, 'msn' => $f_msn, 'aol' => $f_aol, 'gender' => $f_gender, 'birthday' => $f_birthday, 'husbandwife' => $f_husbandwife, 'children' => $f_children, 'trainer' => $f_trainer, 'photo' => $f_photo, 'company' => $f_company, 'cposition' => $f_cposition, 'department' => $f_department, 'coffice' => $f_coffice, 'caddress' => $f_caddress, 'ccity' => $f_ccity, 'cstate' => $f_cstate, 'czip' => $f_czip, 'ccountry' => $f_ccountry, 'cphone' => $f_cphone, 'cfax' => $f_cfax, 'cmobile' => $f_cmobile, 'cpager' => $f_cpager, 'cipphone' => $f_cipphone, 'cwebpage' => $f_cwebpage, 'cphoto' => $f_cphoto, 'ufield1' => $f_userfield1, 'ufield2' => $f_userfield2, 'ufield3' => $f_userfield3, 'ufield4' => $f_userfield4, 'ufield5' => $f_userfield5, 'ufield6' => $f_userfield6, 'ufield7' => $f_userfield7, 'ufield8' => $f_userfield8, 'ufield9' => $f_userfield9, 'ufield10' => $f_userfield10, 'checkword' => $i_checkword));
             $g_vars['page']['notifications'] = $lngstr['page-register']['check_activation_email'];
             include_once $DOCUMENT_PAGES . "signin-1.inc.php";
             break;
         case CONFIG_CONST_upon_registration_sendactivationemailtoadmin: