$rep = true; break; } } if ($rep == false) { fwrite($fp, $row); } } fclose($fp); } require($conf1); $sisterpack_dir = $_CONF['path'] . 'plugins/captcha/class/auth_sister/'.$auth_sister_load; $conf2 = $sisterpack_dir.'/config.inc.php'; if ( file_exists($conf2) ) { if ( is_writable($conf2) ) { // new sister image upload $new_sister_image = ''; $upfile = array(); $upfile = $_FILES['new_sister_image']; if ( isset($upfile['tmp_name']) && $upfile['tmp_name'] != '' ) { $rc = move_uploaded_file($upfile['tmp_name'], $sisterpack_dir.'/'.$upfile['name']); chmod ($sisterpack_dir.'/'.$upfile['name'] , 0644); $new_sister_image = $upfile['name']; } // new font upload $new_sister_font = ''; $upfile = array(); $upfile = $_FILES['new_sister_font']; if ( isset($upfile['tmp_name']) && $upfile['tmp_name'] != '' ) { $rc = move_uploaded_file($upfile['tmp_name'], $sisterpack_dir.'/'.$upfile['name']); chmod ($sisterpack_dir.'/'.$upfile['name'] , 0644); $new_sister_font = basename($upfile['name'],'.ttf'); } $data = file($conf2); $fp = fopen($conf2, "wb"); if ($fp) { foreach ($data as $row) { $rep = false; foreach ($CP_config_auth_sister as $key => $val) { if (strpos($row, '$auth_'.$key) === 0) { switch( $key ) { case 'sister_image': if ($new_sister_image != '') { $str = '$auth_'.$key." = '".$new_sister_image."';\n"; } else { $str = '$auth_'.$key." = '".$val."';\n"; } break; case 'sister_font': if ($new_sister_font != '') { $str = '$auth_'.$key." = '".$new_sister_font."';\n"; } else { $str = '$auth_'.$key." = '".$val."';\n"; } break; case 'sister_fsize': case 'sister_fx': case 'sister_fy': $str = '$auth_'.$key." = ".$val.";\n"; break; } fwrite($fp, $str); $rep = true; break; } } if ($rep == false) { fwrite($fp, $row); } } fclose($fp); } } } // words if ( isset($CP_config_auth_sister['sister_words']) && $CP_config_auth_sister['sister_words'] != '' ) { if ( file_exists($sisterpack_dir.'/words.txt') ) { if ( is_writable($sisterpack_dir.'/words.txt') ) { $fp = fopen($sisterpack_dir.'/words.txt',"wb"); if ($fp) { fwrite($fp, $CP_config_auth_sister['sister_words']); } fclose($fp); } } } // css if ( isset($CP_config_auth_sister['sister_css']) && $CP_config_auth_sister['sister_css'] != '' ) { if ( file_exists($_CONF['path_html'].'captcha/auth_sister.css') ) { if ( is_writable($_CONF['path_html'].'captcha/auth_sister.css') ) { $fp = fopen($_CONF['path_html'].'captcha/auth_sister.css',"wb"); if ($fp) { fwrite($fp, $CP_config_auth_sister['sister_css']); } fclose($fp); } } } } } } $msg = ''; if ( isset($_POST['mode']) ) { $mode = $_POST['mode']; } else { $mode = ''; } if ( $mode == $LANG_CP00['cancel'] && !empty($LANG_CP00['cancel']) ) { header('Location:' . $_CONF['site_admin_url'] . '/moderation.php'); exit; } // Create integration other plugin $other_plugins = CP_getplugin_label(); if ( $mode == $LANG_CP00['save'] && !empty($LANG_CP00['save']) ) { $settings['anonymous_only'] = $_POST['anononly'] == 'on' ? 1 : 0; $settings['remoteusers'] = $_POST['remoteusers'] == 'on' ? 1 : 0; $settings['enable_comment'] = $_POST['comment'] == 'on' ? 1 : 0; $settings['enable_story'] = $_POST['story'] == 'on' ? 1 : 0; $settings['enable_registration'] = $_POST['registration'] == 'on' ? 1 : 0; $settings['enable_contact'] = $_POST['contact'] == 'on' ? 1 : 0; $settings['enable_emailstory'] = $_POST['emailstory'] == 'on' ? 1 : 0; $settings['enable_forum'] = $_POST['forum'] == 'on' ? 1 : 0; $settings['enable_mediagallery'] = $_POST['mediagallery'] == 'on' ? 1: 0; $settings['gfxDriver'] = COM_applyFilter($_POST['gfxdriver']); $settings['gfxFormat'] = COM_applyFilter($_POST['gfxformat']); $settings['gfxPath'] = addslashes($_POST['gfxpath']); $settings['debug'] = $_POST['debug'] == 'on' ? 1 : 0; $settings['imageset'] = COM_applyFilter($_POST['imageset']); // integration other plugin if (count($other_plugins) > 0) { foreach ($other_plugins as $oplugin) { $opi_name = $oplugin['pi_name']; $settings['enable_'.$opi_name] = $_POST[$opi_name] == 'on' ? 1: 0; } } foreach($settings AS $option => $value ) { $value = addslashes($value); DB_save($_TABLES['cp_config'],"config_name,config_value","'$option','$value'"); $_CP_CONF[$option] = stripslashes($value); } // write auth sister setting fo