[trick-with-Wiki] トップ 差分 一覧 Farm ソース 検索 ヘルプ RSS ログイン

WikiListの閲覧制限

カテゴリ[fswiki]

Farmは使いたいけど、どんなFarmが存在するかのリストが見えないように出来たら、と。

plugin/core/AdminFarmHandler.pm

***************
*** 38,47 ****
  	my $cgi     = $wiki->get_CGI();
  	my $create  = $cgi->param("create");
  	my $remove  = $cgi->param("remove");
  	my $usefarm = $cgi->param("usefarm");
  	
  	&Util::save_config_hash($wiki,$wiki->config('farmconf_file'),
! 	                        {create=>$create,remove=>$remove,usefarm=>$usefarm});
  	
  	$wiki->redirectURL($wiki->config('script_name')."?action=ADMINFARM");
  	#return "WikiFarmの設定を保存しました。";
--- 38,48 ----
  	my $cgi     = $wiki->get_CGI();
  	my $create  = $cgi->param("create");
  	my $remove  = $cgi->param("remove");
+ 	my $list    = $cgi->param("list");
  	my $usefarm = $cgi->param("usefarm");
  	
  	&Util::save_config_hash($wiki,$wiki->config('farmconf_file'),
! 	                        {create=>$create,remove=>$remove,list=>$list,usefarm=>$usefarm});
  	
  	$wiki->redirectURL($wiki->config('script_name')."?action=ADMINFARM");
  	#return "WikiFarmの設定を保存しました。";
***************
*** 74,79 ****
--- 75,86 ----
  	$buf   .= "  <input type=\"radio\" name=\"remove\" value=\"1\""; if($config->{remove}==1){ $buf.= " checked"; } $buf.=">ログイン時のみ可能\n";
  	$buf   .= "  <input type=\"radio\" name=\"remove\" value=\"2\""; if($config->{remove}==2){ $buf.= " checked"; } $buf.=">管理者のみ可能\n";
  	$buf   .= "  </p>\n";
+ 	$buf   .= "  <h3>wiki_list許可</h3>\n";
+ 	$buf   .= "  <p>\n";
+ 	$buf   .= "  <input type=\"radio\" name=\"list\" value=\"0\""; if($config->{list}==0){ $buf.= " checked"; } $buf.=">誰でも可能\n";
+ 	$buf   .= "  <input type=\"radio\" name=\"list\" value=\"1\""; if($config->{list}==1){ $buf.= " checked"; } $buf.=">ログイン時のみ可能\n";
+ 	$buf   .= "  <input type=\"radio\" name=\"list\" value=\"2\""; if($config->{list}==2){ $buf.= " checked"; } $buf.=">管理者のみ可能\n";
+ 	$buf   .= "  </p>\n";
  	$buf   .= "  <input type=\"submit\" name=\"save\" value=\"保存\">\n";
  	$buf   .= "  <input type=\"reset\"  value=\"リセット\">\n";
  	$buf   .= "  <input type=\"hidden\" name=\"action\" value=\"ADMINFARM\">\n";

plugin/core/WikiList.pm

***************
*** 27,33 ****
  	my $can_remove = 1;
  	my $login  = $farm->get_login_info();
  	my $config = &Util::load_config_hash($farm,$farm->config('farmconf_file'));
! 	if($config->{remove}==1){
  		if(!defined($login)){ $can_remove = 0; }
  	} elsif($config->{remove}==2){
  		if(!defined($login) || $login->{type}!=0){ $can_remove = 0; }
--- 27,40 ----
  	my $can_remove = 1;
  	my $login  = $farm->get_login_info();
  	my $config = &Util::load_config_hash($farm,$farm->config('farmconf_file'));
! 
!   if($config->{list}==1){
! 		if(!defined($login)){ return; }
! 	} elsif($config->{list}==2){
! 		if(!defined($login) || $login->{type}!=0){ return; }
! 	}
! 
!   if($config->{remove}==1){
  		if(!defined($login)){ $can_remove = 0; }
  	} elsif($config->{remove}==2){
  		if(!defined($login) || $login->{type}!=0){ $can_remove = 0; }
お名前: コメント: