當前位置: 首頁>>代碼示例>>PHP>>正文


PHP save_uc_config函數代碼示例

本文整理匯總了PHP中save_uc_config函數的典型用法代碼示例。如果您正苦於以下問題:PHP save_uc_config函數的具體用法?PHP save_uc_config怎麽用?PHP save_uc_config使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了save_uc_config函數的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: install_uc_server

function install_uc_server()
{
    global $db, $dbhost, $dbuser, $dbpw, $dbname, $tablepre, $username, $password, $email;
    $ucsql = file_get_contents(ROOT_PATH . './uc_server/install/uc.sql');
    $uctablepre = $tablepre . 'ucenter_';
    $ucsql = str_replace(' uc_', ' ' . $uctablepre, $ucsql);
    $ucsql && runucquery($ucsql, $uctablepre);
    $appauthkey = _generate_key();
    $ucdbhost = $dbhost;
    $ucdbname = $dbname;
    $ucdbuser = $dbuser;
    $ucdbpw = $dbpw;
    $ucdbcharset = DBCHARSET;
    $uccharset = CHARSET;
    $pathinfo = pathinfo($_SERVER['PHP_SELF']);
    $pathinfo['dirname'] = substr($pathinfo['dirname'], 0, -8);
    $appurl = 'http://' . preg_replace("/\\:\\d+/", '', $_SERVER['HTTP_HOST']) . ($_SERVER['SERVER_PORT'] && $_SERVER['SERVER_PORT'] != 80 ? ':' . $_SERVER['SERVER_PORT'] : '') . $pathinfo['dirname'];
    $ucapi = $appurl . '/uc_server';
    $ucip = '';
    $app_tagtemplates = 'apptagtemplates[template]=' . urlencode('<a href="{url}" target="_blank">{subject}</a>') . '&' . 'apptagtemplates[fields][subject]=' . urlencode($lang['tagtemplates_subject']) . '&' . 'apptagtemplates[fields][uid]=' . urlencode($lang['tagtemplates_uid']) . '&' . 'apptagtemplates[fields][username]=' . urlencode($lang['tagtemplates_username']) . '&' . 'apptagtemplates[fields][dateline]=' . urlencode($lang['tagtemplates_dateline']) . '&' . 'apptagtemplates[fields][url]=' . urlencode($lang['tagtemplates_url']);
    $db->query("INSERT INTO {$uctablepre}applications SET name='Discuz! Board', url='{$appurl}', ip='{$ucip}', authkey='{$appauthkey}', synlogin='1', charset='{$charset}', dbcharset='{$dbcharset}', type='DISCUZX', recvnote='1', tagtemplates='{$apptagtemplates}'", $link);
    $appid = $db->insert_id($link);
    $db->query("ALTER TABLE {$uctablepre}notelist ADD COLUMN app{$appid} tinyint NOT NULL");
    $config = array($appauthkey, $appid, $ucdbhost, $ucdbname, $ucdbuser, $ucdbpw, $ucdbcharset, $uctablepre, $uccharset, $ucapi, $ucip);
    save_uc_config($config, ROOT_PATH . './config/config_ucenter.php');
    $salt = substr(uniqid(rand()), -6);
    $passwordmd5 = md5(md5($password) . $salt);
    $db->query("INSERT INTO {$uctablepre}members SET {$sqladd} username='{$username}', password='{$passwordmd5}', email='{$email}', regip='hidden', regdate='" . time() . "', salt='{$salt}'");
    $uid = $db->insert_id();
    $db->query("INSERT INTO {$uctablepre}memberfields SET uid='{$uid}'");
    $db->query("INSERT INTO {$uctablepre}admins SET\r\n\t\tuid='{$uid}',\r\n\t\tusername='{$username}',\r\n\t\tallowadminsetting='1',\r\n\t\tallowadminapp='1',\r\n\t\tallowadminuser='1',\r\n\t\tallowadminbadword='1',\r\n\t\tallowadmincredits='1',\r\n\t\tallowadmintag='1',\r\n\t\tallowadminpm='1',\r\n\t\tallowadmindomain='1',\r\n\t\tallowadmindb='1',\r\n\t\tallowadminnote='1',\r\n\t\tallowadmincache='1',\r\n\t\tallowadminlog='1'");
    uc_write_config($config, ROOT_PATH . './uc_server/data/config.inc.php', $password);
    //vot	@unlink(ROOT_PATH.'./uc_server/install/index.php');
    @unlink(ROOT_PATH . './uc_server/data/cache/settings.php');
    @touch(ROOT_PATH . './uc_server/data/upgrade.lock');
    @touch(ROOT_PATH . './uc_server/data/install.lock');
    dir_clear(ROOT_PATH . './uc_server/data/cache');
    dir_clear(ROOT_PATH . './uc_server/data/view');
}
開發者ID:v998,項目名稱:discuzx-en,代碼行數:39,代碼來源:install_function.php

示例2: dfopen

     $ucconfig = dfopen($ucapi . '/index.php', 500, $postdata, '', 1, $ucip);
     if (empty($ucconfig)) {
         //ucenter 驗證失敗
         $result['error'] = 1;
         $result['message'] = '驗證失敗';
     } elseif ($ucconfig == '-1') {
         //管理員密碼無效
         $result['error'] = 1;
         $result['message'] = '創始人密碼錯誤';
     } else {
         list($appauthkey, $appid) = explode('|', $ucconfig);
         if (empty($appauthkey) || empty($appid)) {
             //ucenter 安裝數據錯誤
             $result['error'] = 1;
             $result['message'] = '安裝數據錯誤';
         } elseif ($succeed = save_uc_config($ucconfig . "|{$ucapi}|{$ucip}")) {
             $result['error'] = 0;
             $result['message'] = 'OK';
         } else {
             //config文件寫入錯誤
             $result['error'] = 1;
             $result['message'] = '配置文件寫入錯誤';
         }
     }
     die($json->encode($result));
     break;
     /* 會員數據合並界麵 */
 /* 會員數據合並界麵 */
 case 'usersmerge':
     include ROOT_PATH . 'data/config.php';
     if (UC_CHARSET != EC_CHARSET) {
開發者ID:dw250100785,項目名稱:ECShop-1,代碼行數:31,代碼來源:index.php

示例3: show_msg

             show_msg('uc_dbcharset_incorrect', '', 0);
         }
         $postdata = "m=app&a=add&ucfounder=&ucfounderpw=" . urlencode($ucpw) . "&apptype=" . urlencode($app_type) . "&appname=" . urlencode($app_name) . "&appurl=" . urlencode($app_url) . "&appip=&appcharset=" . CHARSET . '&appdbcharset=' . DBCHARSET . '&' . $app_tagtemplates . '&release=' . UC_CLIENT_RELEASE;
         $ucconfig = dfopen($ucapi . '/index.php', 500, $postdata, '', 1, $ucip);
         if (empty($ucconfig)) {
             show_msg('uc_api_add_app_error', $ucapi, 0);
         } elseif ($ucconfig == '-1') {
             show_msg('uc_admin_invalid', '', 0);
         } else {
             list($appauthkey, $appid) = explode('|', $ucconfig);
             $ucconfig_array = explode('|', $ucconfig);
             $ucconfig_array[] = $ucapi;
             $ucconfig_array[] = $ucip;
             if (empty($appauthkey) || empty($appid)) {
                 show_msg('uc_data_invalid', '', 0);
             } elseif ($succeed = save_uc_config($ucconfig_array, ROOT_PATH . CONFIG_UC)) {
                 if (VIEW_OFF) {
                     show_msg('app_reg_success');
                 } else {
                     $step = $step + 1;
                     header("Location: index.php?step={$step}");
                     exit;
                 }
             } else {
                 show_msg('config_unwriteable', '', 0);
             }
         }
     }
 }
 if (VIEW_OFF) {
     show_msg('missing_parameter', '', 0);
開發者ID:pan289091315,項目名稱:Discuz,代碼行數:31,代碼來源:index.php

示例4: daddslashes

         //更新到UCenter數據庫
         $newapp_appkey = daddslashes($newapp_appkey);
         //echo $newcu_mykey;exit;
         $ucdb = new db_mysql();
         $ucdblink = $ucdb->_dbconnect(UC_DBHOST, UC_DBUSER, UC_DBPW, UC_DBCHARSET, UC_DBNAME);
         $apptablename = UC_DBTABLEPRE . 'applications';
         //					$a = $ucdb->query("SELECT appid,authkey FROM $apptablename");
         //					$apparray = array();
         //					while($data = $ucdb->fetch_array($a)){
         //						$apparray[] = $data;
         //					}
         //echo UC_DBTABLEPRE;exit;
         $uc_dbtablepre = UC_DBTABLEPRE;
         $ucconfig = array($newapp_authkey, UC_APPID, UC_DBHOST, UC_DBNAME, UC_DBUSER, UC_DBPW, UC_DBCHARSET, $uc_dbtablepre, UC_CHARSET, UC_API, UC_IP);
         $ucconfig = @implode('|', $ucconfig);
         save_uc_config($ucconfig, DISCUZ_ROOT . './config/config_ucenter.php');
         $ucdb->query("UPDATE {$apptablename} SET authkey = '{$newapp_appkey}' WHERE appid = " . UC_APPID);
         //note
     } else {
         $cpmessage .= $toolslang['nlocaluc'];
     }
     // $authkey = substr(md5($_SERVER['SERVER_ADDR'].$_SERVER['HTTP_USER_AGENT'].$dbhost.$dbuser.$dbpw.$dbname.$username.$password.$pconnect.substr($timestamp, 0, 6)), 8, 6).random(10);
 } elseif ($value == 'config_authkey') {
     $default_config = $_config;
     $authkey = substr(md5($_SERVER['SERVER_ADDR'] . $_SERVER['HTTP_USER_AGENT'] . $dbhost . $dbuser . $dbpw . $dbname . $username . $password . $pconnect . substr($timestamp, 0, 8)), 8, 6) . random(10);
     $_config['security']['authkey'] = $authkey;
     $cpmessage .= $toolslang['resetauthkey'];
     save_config_file('./config/config_global.php', $_config, $default_config);
 } elseif ($value == 'setting_authkey') {
     $authkey = substr(md5($_SERVER['SERVER_ADDR'] . $_SERVER['HTTP_USER_AGENT'] . $dbhost . $dbuser . $dbpw . $dbname . $username . $password . $pconnect . substr($timestamp, 0, 8)), 8, 6) . random(10);
     DB::update('common_setting', array('svalue' => $authkey), "skey = 'authkey'");
開發者ID:Jaedeok-seol,項目名稱:discuz_template,代碼行數:31,代碼來源:changekey.inc.php

示例5: elseif

    elseif($ucconfig == '-1')
    {
        //管理員密碼無效
        $result['error'] = 1;
        $result['message'] = $_LANG['ucenter_creator_wrong_password'];
    }
    else
    {
        list($appauthkey, $appid) = explode('|', $ucconfig);
        if(empty($appauthkey) || empty($appid))
        {
            //ucenter 安裝數據錯誤
            $result['error'] = 1;
            $result['message'] = $_LANG['ucenter_data_error'];
        }
        elseif(($succeed = save_uc_config($ucconfig."|$ucapi|$ucip")))
        {
            $result['error'] = 0;
            $result['message'] = 'OK';
        }
        else
        {
            //config文件寫入錯誤
            $result['error'] = 1;
            $result['message'] = $_LANG['ucenter_config_error'];
        }
    }
    die($json->encode($result));

    break;
開發者ID:noikiy,項目名稱:mdwp,代碼行數:30,代碼來源:index.php

示例6: elseif

				show_msg('uc_version_incorrect', $ucversion, 0);
			} elseif($dbcharset && $ucdbcharset != $dbcharset) {
				show_msg('uc_dbcharset_incorrect', '', 0);
			}

			$postdata = "m=app&a=add&ucfounder=&ucfounderpw=".urlencode($ucpw)."&apptype=".urlencode($app_type)."&appname=".urlencode($app_name)."&appurl=".urlencode($app_url)."&appip=&appcharset=".CHARSET.'&appdbcharset='.DBCHARSET.'&'.$app_tagtemplates.'&release='.UC_CLIENT_RELEASE;
			$ucconfig = dfopen($ucapi.'/index.php', 500, $postdata, '', 1, $ucip);
			if(empty($ucconfig)) {
				show_msg('uc_api_add_app_error', $ucapi, 0);
			} elseif($ucconfig == '-1') {
				show_msg('uc_admin_invalid', '', 0);
			} else {
				list($appauthkey, $appid) = explode('|', $ucconfig);
				if(empty($appauthkey) || empty($appid)) {
					show_msg('uc_data_invalid', '', 0);
				} elseif($succeed = save_uc_config($ucconfig."|$ucapi|$ucip", CONFIG)) {
					if(VIEW_OFF) {
						show_msg('app_reg_success');
					} else {
						$step = $step + 1;
						header("Location: index.php?step=$step");
						exit;
					}
				} else {
					show_msg('config_unwriteable', '', 0);
				}
			}
		}

	}
	if(VIEW_OFF) {
開發者ID:BGCX262,項目名稱:zyyhong-svn-to-git,代碼行數:31,代碼來源:index.php

示例7: show_msg

         if (UC_CLIENT_VERSION > $ucversion) {
             show_msg('uc_version_incorrect', $ucversion, 0);
         } elseif ($dbcharset && $ucdbcharset != $dbcharset) {
             show_msg('uc_dbcharset_incorrect', '', 0);
         }
         $postdata = "m=app&a=add&ucfounder=&ucfounderpw=" . urlencode($ucpw) . "&apptype=" . urlencode($app_type) . "&appname=" . urlencode($app_name) . "&appurl=" . urlencode($app_url) . "&appip=&appcharset=" . CHARSET . '&appdbcharset=' . DBCHARSET . '&' . $app_tagtemplates . '&release=' . UC_CLIENT_RELEASE;
         $ucconfig = dfopen($ucapi . '/index.php', 500, $postdata, '', 1, $ucip);
         if (empty($ucconfig)) {
             show_msg('uc_api_add_app_error', $ucapi, 0);
         } elseif ($ucconfig == '-1') {
             show_msg('uc_admin_invalid', '', 0);
         } else {
             list($appauthkey, $appid) = explode('|', $ucconfig);
             if (empty($appauthkey) || empty($appid)) {
                 show_msg('uc_data_invalid', '', 0);
             } elseif ($succeed = save_uc_config($ucconfig . "|{$ucapi}|{$ucip}", ROOT_PATH . CONFIG_UC)) {
                 if (VIEW_OFF) {
                     show_msg('app_reg_success');
                 } else {
                     $step = $step + 1;
                     header("Location: index.php?step={$step}");
                     exit;
                 }
             } else {
                 show_msg('config_unwriteable', '', 0);
             }
         }
     }
 }
 if (VIEW_OFF) {
     show_msg('missing_parameter', '', 0);
開發者ID:Kingson4Wu,項目名稱:php_demo,代碼行數:31,代碼來源:index.php

示例8: pathinfo

 $ucdbcharset = $dbcharset;
 $uccharset = $charset;
 $pathinfo = pathinfo($_SERVER['PHP_SELF']);
 $pathinfo['dirname'] = substr($pathinfo['dirname'], 0, -8);
 $appurl = 'http://' . preg_replace("/\\:\\d+/", '', $_SERVER['HTTP_HOST']) . ($_SERVER['SERVER_PORT'] && $_SERVER['SERVER_PORT'] != 80 ? ':' . $_SERVER['SERVER_PORT'] : '') . $pathinfo['dirname'];
 $ucapi = $appurl . '/uc_server';
 $ucip = '127.0.0.1';
 $app_tagtemplates = 'apptagtemplates[template]=' . urlencode('<a href="{url}" target="_blank">{subject}</a>') . '&' . 'apptagtemplates[fields][subject]=' . urlencode($lang['tagtemplates_subject']) . '&' . 'apptagtemplates[fields][uid]=' . urlencode($lang['tagtemplates_uid']) . '&' . 'apptagtemplates[fields][username]=' . urlencode($lang['tagtemplates_username']) . '&' . 'apptagtemplates[fields][dateline]=' . urlencode($lang['tagtemplates_dateline']) . '&' . 'apptagtemplates[fields][url]=' . urlencode($lang['tagtemplates_url']);
 $db->query("INSERT INTO {$uctablepre}applications SET name='Discuz! Board', url='{$appurl}', ip='{$ucip}', authkey='{$appauthkey}', synlogin='1', charset='{$charset}', dbcharset='{$dbcharset}', type='DISCUZ', recvnote='1', tagtemplates='{$apptagtemplates}'", $link);
 $appid = $db->insert_id($link);
 if ($appid < 1) {
     instmsg('reg_app_to_ucenter_fail');
 }
 $db->query("ALTER TABLE {$uctablepre}notelist ADD COLUMN app{$appid} tinyint NOT NULL");
 $config = "{$appauthkey}|{$appid}|{$ucdbhost}|{$ucdbname}|{$ucdbuser}|{$ucdbpw}|{$ucdbcharset}|{$uctablepre}|{$uccharset}|{$ucapi}|{$ucip}";
 save_uc_config($config, DISCUZ_ROOT . './config.inc.php');
 $username = getgpc('username', 'p');
 $email = getgpc('email', 'p');
 $password1 = getgpc('password1', 'p');
 $password2 = getgpc('password2', 'p');
 $uid = 0;
 if ($username && $email && $password1 && $password2) {
     if ($password1 != $password2) {
         $error_admin['password2'] = 'admin_password_invalid';
     } elseif (strlen($username) > 15 || preg_match("/^\$|^c:\\con\\con\$|║║|[,\"\\s\t\\<\\>&]|^сн©м|^Guest/is", $username)) {
         $error_admin['username'] = 'admin_username_invalid';
     } elseif (!strstr($email, '@') || $email != stripslashes($email) || $email != htmlspecialchars($email)) {
         $error_admin['email'] = 'admin_email_invalid';
     } else {
         $salt = substr(uniqid(rand()), -6);
         $password = md5(md5($password1) . $salt);
開發者ID:BGCX067,項目名稱:f2cont-svn-to-git,代碼行數:31,代碼來源:index.php


注:本文中的save_uc_config函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。