Tadashi Okoshi
slash****@users*****
2005年 12月 19日 (月) 14:16:19 JST
Index: affelio/lib/Affelio/SNS/Handshaker_s.pm
diff -u affelio/lib/Affelio/SNS/Handshaker_s.pm:1.29 affelio/lib/Affelio/SNS/Handshaker_s.pm:1.30
--- affelio/lib/Affelio/SNS/Handshaker_s.pm:1.29 Sat Dec 10 11:12:28 2005
+++ affelio/lib/Affelio/SNS/Handshaker_s.pm Mon Dec 19 14:16:19 2005
@@ -14,7 +14,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
-# $Id: Handshaker_s.pm,v 1.29 2005/12/10 02:12:28 slash5234 Exp $
+# $Id: Handshaker_s.pm,v 1.30 2005/12/19 05:16:19 slash5234 Exp $
########################################################################
#package Affelio::SNS::Handshaker_s::Util;
@@ -90,17 +90,19 @@
#################################
#authentication
#################################
- #distill username
+ #distill visiter_afid
$xwsse_mesg =~ /Username="(.*)",(\s*)Password/;
- my $username = $1;
- debug_print("S::get_news username = [$username]");
+ my $visitor_afid = $1;
+ debug_print("S::get_news visitor_afid = [$visitor_afid]");
#get password
- my $passAB = $af->getFM()->get_attribute_by_afid($username, "password");
+ my $passAB = $af->getFM()->get_attribute_by_afid($visitor_afid,
+ "password");
debug_print("S::get_news passAB = [$passAB]");
- #auth
- if(Affelio::misc::WSSE::authenticate($xwsse_mesg,$username,$passAB)){
+ #WSSE authentication
+ if(Affelio::misc::WSSE::authenticate($xwsse_mesg,
+ $visitor_afid, $passAB)){
debug_print("S::get_news WSSE authentication OK.");
}else{
debug_print("S::get_news WSSE authentication NG.");
@@ -111,9 +113,33 @@
}
#################################
+ #get list of apps the user can access
+ #################################
+ my @app_list=();
+ my $this_app_ref;
+ my $tmp_name;
+ while ( ($tmp_name, $this_app_ref) = each( %{$af->getAM->{apps}} ) ){
+ my %this_app = %$this_app_ref;
+
+ my $perm_to_tab=0;
+ $perm_to_tab
+ = $self->getAM->get_summed_app_perm($visitor_afid,
+ "f1",
+ $this_app{'install_name'},
+ "DF_access");
+ if($perm_to_tab ==1 ){
+ push(@app_list, $this_app{'install_name'});
+ }
+
+ }
+ #while
+ debug_print("S::get_news: app_list = @app_list");
+
+
+ #################################
#get what's new contents
#################################
- my $last_news_out = $af->getFM()->get_attribute_by_afid($username,
+ my $last_news_out = $af->getFM()->get_attribute_by_afid($visitor_afid,
"last_news_out");
debug_print("S::get_news last_news_out=[$last_news_out]");
@@ -128,11 +154,10 @@
#################################
#update last_news_out
#################################
- my $uid = $af->getFM()->get_attribute_by_afid($username, "uid");
+ my $uid = $af->getFM()->get_attribute_by_afid($visitor_afid, "uid");
$af->getFM()->set_attribute_by_id($uid, "last_news_out",
Affelio::misc::Time::get_timestamp());
-
#################################
#send back return message
#################################