yunset("sy_weburl",$this->config['sy_weburl']); $path = APP_PATH."data/api/uc/config.inc.php"; require_once $path; $this->yunset("ucinfo",$ucinfo); $this->yuntpl(array('admin/admin_uc')); } function save_action(){ $config = "$value) { $config.= "define(\"".$key."\",\"".$value."\"); \r\n"; $parr .= "\"".$key."\"=>\"".$value."\","; } $parr = rtrim($parr,","); $config .= "\$ucinfo=array(".$parr."); \r\n"; } $path = APP_PATH."data/api/uc/config.inc.php"; $fp = @fopen($path,"w"); fwrite($fp,$config); fclose($fp); $this -> MODEL('config') -> setConfig(array('sy_uc_type'=>$sy_uc_type)); $this->web_config(); $this->ACT_layer_msg("保存成功!",9,"index.php?m=admin_uc",2,1); } function pw_action(){ $this->yunset("sy_weburl",$this->config['sy_weburl']); $path = APP_PATH."data/api/pw_api/pw_config.php"; require_once $path; $this->yunset("ucinfo",$ucinfo); $this->yuntpl(array('admin/admin_pw')); } function pwsave_action() { $configM = $this -> MODEL('config'); $userinfoM = $this -> MODEL('userinfo'); $config = "$value){ $config.= "define(\"".$key."\",\"".$value."\"); \r\n"; $parr .= "\"".$key."\"=>\"".$value."\","; } $parr = rtrim($parr,","); $config .= "\$ucinfo=array(".$parr."); \r\n"; } $path = APP_PATH."data/api/pw_api/pw_config.php"; $fp = @fopen($path,"w"); fwrite($fp,$config); fclose($fp); $configM -> setConfig(array('sy_pw_type'=>$sy_pw_type)); $configM -> upInfo(array('name'=>'sy_uc_type'),array('config'=>'')); $this->web_config(); if($sy_pw_type=='pw_center'){ $user_arr = $userinfoM -> getList("1",array('field'=>'`uid`,`username`,`password`,`salt`')); require_once APP_PATH.'/api/pw_api/pw_client/class_db.php'; $db_uc = new UcDB; include(APP_PATH."data/api/pw_api/pw_config.php"); $db_uc->connect(UC_DBHOST, UC_DBUSER, UC_DBPW, UC_DBNAME, UC_DBCONNECT, UC_DBCHARSET); $pw_query=$db_uc->query("SELECT `uid`,`username`,`password` FROM ".UC_DBTABLEPRE."members"); while($pw_rs = $db_uc->fetch_array($pw_query)){ if(is_array($user_arr)){ foreach($user_arr as $key=>$value){ //判断是否有重名用户 if($value['username']==$pw_rs['username']&&$value['pw_repeat']!="1"){ if($value['pwuid']<1){ //判断密码是否一致 if($value['password']==md5($pw_rs['password'].$value['salt'])){ //用户名密码一致,绑定用户PWid $userinfoM -> upInfo(array('pwuid'=>$pw_rs['uid']),array('uid'=>$value['uid'])); }else{ //用户名密码不一致设定为重名用户,不予同步 $userinfoM -> upInfo(array('pw_repeat'=>'1'),array('uid'=>$value['uid'])); } } } } } } } $this->ACT_layer_msg("保存成功!",9,"index.php?m=admin_uc&c=pw"); } } ?>