Tadashi Okoshi
slash****@users*****
2005年 10月 25日 (火) 04:20:54 JST
Index: affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/AccessControl.pm
diff -u affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/AccessControl.pm:1.1.1.1 affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/AccessControl.pm:removed
--- affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/AccessControl.pm:1.1.1.1 Tue Oct 25 04:14:40 2005
+++ affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/AccessControl.pm Tue Oct 25 04:20:53 2005
@@ -1,257 +0,0 @@
-# Copyright (C) 2005 FishGrove Inc.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# $Id: AccessControl.pm,v 1.1.1.1 2005/10/24 19:14:40 slash5234 Exp $
-
-package Affelio::App::Admin::AccessControl;
-{
- use strict;
-
- use lib("../../../../extlib/");
- use lib("../../../../lib/");
- use Affelio;
- use Affelio::misc::CGIError;
- use Affelio::misc::Debug qw(debug_print);
- use Affelio::misc::MyCrypt qw( msg_encrypt url_encode);
-
- use Exporter;
- @Affelio::App::Admin::AccessControl::ISA = "Exporter";
- @Affelio::App::Admin::AccessControl::EXPORT = qw (show_GroupAttribute_table save_GroupAttribute_table);
-
- #####################################################################
- #save_GroupAttribute_table
- #####################################################################
- sub save_GroupAttribute_table{
- my $af = shift; #arg(1) AF
- my $q = shift; #arg(2) CGI
-
- my @params = $q->param;
- foreach my $i (@params){
- debug_print("save_GroupAttribute_tbl: [$i] =". $q->param($i));
- }
-
- #######################################################
- # Save F1, F2, and PB
- {
- my @gids = ("f1", "f2", "pb");
- my @group_names = ($af->{lh}->maketext("_VISITOR_TYPE_F1"),
- $af->{lh}->maketext("_VISITOR_TYPE_F2"),
- $af->{lh}->maketext("_VISITOR_TYPE_PB"));
- my @option_pids = (1,2,3);
-
- for(my $i=0; $i<3; $i++){
- my $gid = $gids[$i];
- my $group_name = $group_names[$i];
- my $option_pid = $option_pids[$i];
-
- debug_print("save_GroupAttribute_table: For group[$gid]...");
-
- #Get attribute table
- my $attributes = $af->{pm}->get_attribute_table();
-
- #Set values
- my @g_perm=();
- while(my ($attr_id, $attr_name, $attr_type)
- = $attributes->fetchrow_array){
- if($q->param("f__" . $gid . "__" . $attr_name) eq "on"){
- $g_perm[$attr_id] = 1;
- }else{
- $g_perm[$attr_id] = 0;
- }
- }
- $g_perm[0] = 1;
- debug_print("save_GroupAttribute_table: group_permission=[@g_perm]");
- $af->{perm}->update_permission($option_pid, \@g_perm);
-
- } #while
- }#part
-
-
- #######################################################
- # Save registered groups
- {
- my $groups_SQL = $af->{gm}->get_all_group_list();
-
- #For each group returned...
- while( (my ($gid, $group_name, $members, $option_pid)
- = $groups_SQL->fetchrow_array)){
-
- debug_print("save_GroupAttribute_table: For group[$gid] (pid=$option_pid)...");
- if($gid <1){last;}
-
- #Get attribute table
- my $attributes = $af->{pm}->get_attribute_table();
-
- #Set values
- my @g_perm=();
- while(my ($attr_id, $attr_name, $attr_type)
- = $attributes->fetchrow_array){
- if($q->param("g__" . $gid . "__" . $attr_name) eq "on"){
- $g_perm[$attr_id] = 1;
- }else{
- $g_perm[$attr_id] = 0;
- }
- }
- $g_perm[0] = 1;
- debug_print("save_GroupAttribute_table: group_permission=[@g_perm]");
- $af->{perm}->update_permission($option_pid, \@g_perm);
-
- }#while
- }#part
-
- #######################################################
- # Save newly added group
- {
- if($q->param("newg_group_name") ne ""){
-
- my $gid = $af->{gm}->add_group($q->param("newg_group_name"));
-
- #Get attribute table
- my $attributes = $af->{pm}->get_attribute_table();
-
- #Set values
- my @g_perm=();
- while(my ($attr_id, $attr_name, $attr_type)
- = $attributes->fetchrow_array){
- if($q->param("newg_" . $attr_name) eq "on"){
- $g_perm[$attr_id] = 1;
- }else{
- $g_perm[$attr_id] = 0;
- }
- }
- $g_perm[1] = 1;
- debug_print("save_GroupAttribute_table: newg group=[@g_perm]");
- $af->{perm}->add_permission("g", $gid, \@g_perm);
-
- }
- }
- }
-
-
- #####################################################################
- #show_GroupAttribute_table
- #####################################################################
- sub show_GroupAttribute_table{
- my $af = shift; #arg(1) AF
- my $output_ref = shift; #arg(3) ref of %output_data;
-
- debug_print("show_GroupAttribute_table: start.");
- my @groups_ret1=();
- my @groups_ret2=();
-
- #######################################################
- # F1, F2, and PB
- {
- my @gids = ("f1", "f2", "pb");
- my @group_names = ($af->{lh}->maketext("_VISITOR_TYPE_F1"),
- $af->{lh}->maketext("_VISITOR_TYPE_F2"),
- $af->{lh}->maketext("_VISITOR_TYPE_PB"));
- my @option_pids = (1,2,3);
-
- for(my $i=0; $i<3; $i++){
- my $gid = $gids[$i];
- my $group_name = $group_names[$i];
- my $option_pid = $option_pids[$i];
-
- debug_print("show_GroupAttribute_table: For group[$gid]...");
-
- #set group_name
- my %this_group_ret =();
- $this_group_ret{"group_name"} = $group_name;
-
- #For each group, get the permission list.
- my $g_perm_result = $af->{perm}->get_permission("f", "$gid");
- my @g_perm = $g_perm_result->fetchrow_array;
- debug_print("show_GroupAttribute_table: group_permission=[@g_perm]");
- #Get attribute table
- my $attributes = $af->{pm}->get_attribute_table();
-
- #Set values
- while(my ($attr_id, $attr_name, $attr_type)
- = $attributes->fetchrow_array){
-
- debug_print("show_GroupAttribute_table: attr_id=$attr_id ($attr_name)");
-
- $this_group_ret{"chkbox_id__" . $attr_name}
- = "f__" . $gid . "__" . $attr_name;
-
- if($g_perm[$attr_id+3] >= 1){
- $this_group_ret{"chkbox_chkd_flg__" . $attr_name}
- ="checked";
- }else{
- $this_group_ret{"chkbox_chkd_flg__" . $attr_name}
- ="";
- }
- }
-
- push(@groups_ret1, \%this_group_ret);
-
-
- } #while
-
- }#part
-
-
- #######################################################
- # Registered Groups
- my $groups_SQL = $af->{gm}->get_all_group_list();
-
- #For each group returned...
- while( (my ($gid, $group_name, $members, $option_pid)
- = $groups_SQL->fetchrow_array)){
-
- debug_print("show_GroupAttribute_table: For group[$gid]...");
-
- if($gid <1){last;}
-
- #set group_name
- my %this_group_ret =();
- $this_group_ret{"group_name"} = $group_name;
-
- #For each group, get the permission list.
- my $g_perm_result = $af->{perm}->get_permission("g", "$gid");
- my @g_perm = $g_perm_result->fetchrow_array;
- debug_print("show_GroupAttribute_table: group_permission=[@g_perm]");
- #Get attribute table
- my $attributes = $af->{pm}->get_attribute_table();
-
- #Set values
- while(my ($attr_id, $attr_name, $attr_type)
- = $attributes->fetchrow_array){
-
- $this_group_ret{"chkbox_id__" . $attr_name}
- = "g__" . $gid . "__" . $attr_name;
-
- if($g_perm[$attr_id+3] >= 1){
- $this_group_ret{"chkbox_chkd_flg__" . $attr_name}
- ="checked";
- }else{
- $this_group_ret{"chkbox_chkd_flg__" . $attr_name}
- ="";
- }
- }
-
- push(@groups_ret2, \%this_group_ret);
- }#while
-
- $output_ref->{"groups1"} = \@groups_ret1;
- $output_ref->{"groups2"} = \@groups_ret2;
-
- }
-
-
-}#package
-1;
Index: affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/AccessLog.pm
diff -u affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/AccessLog.pm:1.1.1.1 affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/AccessLog.pm:removed
--- affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/AccessLog.pm:1.1.1.1 Tue Oct 25 04:14:40 2005
+++ affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/AccessLog.pm Tue Oct 25 04:20:53 2005
@@ -1,114 +0,0 @@
-# Copyright (C) 2005 FishGrove Inc.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# $Id: AccessLog.pm,v 1.1.1.1 2005/10/24 19:14:40 slash5234 Exp $
-
-package Affelio::App::Admin::AccessLog;
-{
- use strict;
-
- use lib("../../../../extlib/");
- use lib("../../../");
- use Affelio;
- use Affelio::misc::CGIError;
- use Affelio::misc::Debug qw(debug_print);
- use Affelio::misc::Encoding qw(db_encode db_decode);
- use Affelio::misc::Time;
- use Affelio::misc::WebInput;
-
- use Exporter;
- @Affelio::App::Admin::AccessLog::ISA = "Exporter";
- @Affelio::App::Admin::AccessLog::EXPORT = qw (show);
-
-
- #######################################################################
- #show
- #######################################################################
- sub show{
- my $af= shift;
- my $q=shift;
- my $output_ref = shift;
- my $wi = new Affelio::misc::WebInput;
-
- debug_print("AccessLog::show start.");
-
- my @access_log=();
- $output_ref->{"access_log"} = \@access_log;
-
- ###############################
- #start and end time
- ###############################
- #my $start_time = get_today();
- my $start_time = "20050620000000";
- my $cur_time = get_timestamp();
-
- ###############################
- #Today's date
- ###############################
- #my $t_year = substr ($start_time, 0, 4);
- #my $t_mon = substr ($start_time, 4, 2);
- #my $t_mday = substr ($start_time, 6, 2);
- #$output_ref->{"log_date"} = "$t_year/$t_mon/$t_mday";
-
- ###############################
- #Access to AccessLog Manager
- ###############################
- my $result = $af->{alm}->get_log($start_time, $cur_time);
-
- ###############################
- #Parse result
- ###############################
- while( my ($id, $id2, $time, $nickname, $afid, $type) = $result->fetchrow_array ){
-
- my $true_name;
- if($afid =~ /^http:\/\//){
- ##########
- #Friend!
- ##########
- $true_name = '<A HREF="' . $af->{site__web_root} . "/outgoing.cgi?dest_url=" . $afid . '" target="_blank">' . $nickname . '</A>';
- }else{
- ##########
- #Anonymous
- #afid = remote host
- ##########
- my $len = length($afid);
- if($len > 20){
- $true_name = '<SPAN TITLE="' . $afid . '">...' . substr($afid, $len-20, 20) . '</SPAN>';
- }else{
- $true_name = $afid;
- }
- }
-
- if($id2 ==0 ){ $id2="";}
-
- my $true_type;
- if($type eq "pb") {$true_type='<AF_M text="_VISITOR_TYPE_PB">';}
- if($type eq "f2") {$true_type='<AF_M text="_VISITOR_TYPE_F2">';}
- if($type eq "f1") {$true_type='<AF_M text="_VISITOR_TYPE_F1">';}
- if($type eq "self") {$true_type='<AF_M text="_VISITOR_TYPE_SELF">';}
- push(@access_log, {id=> $id,
- id2=> $id2,
- time=> timestamp2stringB($time),
- nickname => $true_name,
- type => $true_type});
- }
-
- debug_print("AccessLog::show end.");
- }
-
-
-}
-1;
Index: affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/AffelioNews.pm
diff -u affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/AffelioNews.pm:1.1.1.1 affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/AffelioNews.pm:removed
--- affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/AffelioNews.pm:1.1.1.1 Tue Oct 25 04:14:40 2005
+++ affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/AffelioNews.pm Tue Oct 25 04:20:53 2005
@@ -1,122 +0,0 @@
-# Copyright (C) 2005 FishGrove Inc.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# $Id: AffelioNews.pm,v 1.1.1.1 2005/10/24 19:14:40 slash5234 Exp $
-
-package Affelio::App::Admin::AffelioNews;
-{
- use strict;
-
- use lib("../../../../extlib/");
- use Error qw(:try);
- use Fcntl;
- use LWP::Simple 'get';
- use lib("../../../");
- use Affelio;
- use Affelio::misc::CGIError;
- use Affelio::misc::Debug qw(debug_print);
- use Affelio::misc::WebInput qw(delete_HTML);
- use Affelio::exception::IOException;
- use Affelio::misc::Time;
-
- use Exporter;
- @Affelio::App::Admin::AffelioNews::ISA = "Exporter";
- @Affelio::App::Admin::AffelioNews::EXPORT = qw (getnews getRSS);
-
- #######################################################################
- #getRSS
- #######################################################################
- sub getRSS{
- my $af = shift;
-
- if(-e "$af->{site__user_dir}/AffelioNews/"){
- }else{
- mkdir("$af->{site__user_dir}/AffelioNews/");
- if($@){
- throw Affelio::exception::IOException("Cannot make directory for AffelioNews!");
- }
- }
-
- #Load last-updated time
- my $updated_time =0;
- my $cur_time = get_timestamp();
- sysopen(IN, "$af->{site__user_dir}/AffelioNews/update", O_RDONLY);
- if($@){
- }else{
- $updated_time = <IN>;
- if($cur_time < $updated_time + 010000){
- return;
- }
- }
- close(IN);
-
- my $url = "http://home1.affelio.jp/affelio_news/"
- . $af->{site__locale} . "/index.txt";
- if($af->{site__locale} eq "en_us"){
- $url = "http://affelio.us/affelio_news/en_us/index.txt";
- }
-
- my $data = LWP::Simple::get($url);
- if($@){
- #throw Affelio::exception::NetworkException("Network connection error to affelio web site");
- return();
- }
-
- sysopen(OUT, "$af->{site__user_dir}/AffelioNews/news.html",
- O_WRONLY|O_CREAT|O_TRUNC);
-
- my @elements = split('\n', $data);
- my $size = @elements;
- my $index=0;
- while($index < $size){
- my $datetime = timestamp2string($elements[$index++]);
- my $type = $elements[$index++];
- my $title = $elements[$index++];
- my $url = $elements[$index++];
-
- print OUT "<TR><TH>$datetime</TH><TD><A HREF=\"$url\" target=\"_blank\">$title</A></TD></TR>";
- }
-
- print OUT "\n\0";
- close(OUT);
-
- #Record current time
- sysopen(OUT, "$af->{site__user_dir}/AffelioNews/update",
- O_WRONLY|O_CREAT|O_TRUNC);
- print OUT $cur_time;
- close(OUT);
- }
-
- #######################################################################
- #getnews
- #######################################################################
- sub getnews{
- my $af = shift;
- my $output_ref = shift;
-
- getRSS($af);
-
- sysopen(IN, "$af->{site__user_dir}/AffelioNews/news.html",
- O_RDONLY);
- if(!$@){
- $output_ref->{"AffelioNews"} = <IN>;
- }
- close(IN);
- }
-
-
-}
-1;
Index: affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/Configuration.pm
diff -u affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/Configuration.pm:1.1.1.1 affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/Configuration.pm:removed
--- affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/Configuration.pm:1.1.1.1 Tue Oct 25 04:14:40 2005
+++ affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/Configuration.pm Tue Oct 25 04:20:53 2005
@@ -1,141 +0,0 @@
-# Copyright (C) 2005 FishGrove Inc.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# $Id: Configuration.pm,v 1.1.1.1 2005/10/24 19:14:40 slash5234 Exp $
-
-package Affelio::App::Admin::Configuration;
-{
- use strict;
-
- use lib("../../../../extlib/");
- use lib("../../../");
- use Affelio;
- use Affelio::misc::CGIError;
- use Affelio::misc::Debug qw(debug_print);
- use Affelio::misc::Encoding qw(db_encode db_decode);
- use Affelio::misc::Time qw(timestamp2string);
- use Affelio::misc::WebInput;
-
- use Exporter;
- @Affelio::App::Admin::Configuration::ISA = "Exporter";
- @Affelio::App::Admin::Configuration::EXPORT = qw (show configure);
-
- #######################################################################
- #configure
- #######################################################################
- sub configure{
- my $af= shift;
- my $cgi = shift;
-
- debug_print("Config::conf: start.");
- my $wi = new Affelio::misc::WebInput;
-
- ##############################################
- #Top page
- ##############################################
- my $toppage = $wi->PTN_word($cgi->param("toppage"));
- $af->{userpref__toppage_app_installname} = $toppage;
- debug_print("Config::conf: toppage=[$toppage]");
-
- ##############################################
- #Messaging
- ##############################################
- my $val = $wi->PTN_word($cgi->param("pref__mesging__emailflg"));
- debug_print("Config::conf: mesging__emailflg=[$val]");
- if($val eq "no"){
- $af->{userpref__mesging__emailflg} = "no";
- }else{
- $af->{userpref__mesging__emailflg} = "yes";
- }
-
- ##############################################
- #Preferred Hosting Service
- ##############################################
- $af->{userpref__preferred_hosting_service} =
- $wi->PTN_URL($cgi->param("pref__hosting_service"));
-
- $af->write_user_prefs();
- debug_print("Config::conf: end.");
- }
-
-
-
- #######################################################################
- #show
- #######################################################################
- sub show{
- my $af= shift;
- my $output_ref = shift;
-
- debug_print("Config::show start.");
-
- ##############################################
- #Top Page
- ##############################################
- my @applications=();
- my $install_name;
- my $app;
- my $core_flag="";
- my $app_flag="";
-
- $output_ref->{"applications"} = \@applications;
- if($af->{userpref__toppage_app_installname} eq "Affelio"){
- $core_flag="true";
- }
- ###############
- #Core
- ###############
- push(@applications, {install_title => "Affelio Core",
- install_name => "Affelio",
- selected => $core_flag} );
- ###############
- #Apps
- ###############
- while (($install_name, $app) = each(%{$af->{am}->{apps}})){
-
- if($af->{userpref__toppage_app_installname}
- eq $app->{install_name}){
- $app_flag="true";
- }else{
- $app_flag="";
- }
-
- push(@applications, {install_title => "(Application) " .
- $app->{install_title},
- install_name => $app->{install_name},
- selected => $app_flag}
- );
- }
-
- ##############################################
- #Messaging
- ##############################################
- my $name = "pref__mesging_emailflg__"
- . $af->{userpref__mesging__emailflg};
- $output_ref->{$name} = "checked";
-
- ##############################################
- #Preferred Hosting Service
- ##############################################
- $output_ref->{"pref__hosting_service"} =
- $af->{userpref__preferred_hosting_service};
-
- debug_print("Config::show end.");
- }
-
-
-}
-1;
Index: affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/EditProfile.pm
diff -u affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/EditProfile.pm:1.1.1.1 affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/EditProfile.pm:removed
--- affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/EditProfile.pm:1.1.1.1 Tue Oct 25 04:14:40 2005
+++ affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/EditProfile.pm Tue Oct 25 04:20:53 2005
@@ -1,156 +0,0 @@
-# Copyright (C) 2005 FishGrove Inc.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# $Id: EditProfile.pm,v 1.1.1.1 2005/10/24 19:14:40 slash5234 Exp $
-
-package Affelio::App::Admin::EditProfile;
-{
- use strict;
-
- use lib("../../../../extlib/");
- use lib("../../../");
- use Affelio;
- use Affelio::misc::CGIError;
- use Affelio::misc::Debug qw(debug_print);
- use Affelio::misc::MyCrypt qw( msg_encrypt url_encode);
-
- use Exporter;
- @Affelio::App::Admin::EditProfile::ISA = "Exporter";
- @Affelio::App::Admin::EditProfile::EXPORT = qw (show_profileeditor show_profile save_profile);
-
-
- #######################################################################
- #set_profile_into_hash__show
- #######################################################################
- sub set_profile_into_hash__show{
- my $self = shift;
- my $af = $self->{af};
- my $output_data_ref = shift;
- my $viewers_mode = shift;
- debug_print("set_profile_into_hash__show: start mode=[$viewers_mode]");
-
- foreach my $key (sort keys %$af){
- #debug_print("set_profile_into_hash: " . $key . "=" . $af->{$key});
-
- if($key =~ /user__mode_/){
- my $key2 = $key;
- $key2 =~ s/user__mode_//;
-
- if( (($af->{$key} eq "na")
- && ($viewers_mode eq "self"))
- ||
- (($af->{$key} eq "f1")
- && (($viewers_mode eq "self")
- || ($viewers_mode eq "f1"))
- )
- ||
- (($af->{$key} eq "f2")
- && (($viewers_mode eq "self")
- || ($viewers_mode eq "f1")
- || ($viewers_mode eq "f2"))
- )
- ||
- ($af->{$key} eq "pb")
- ){
-
- my $key3 = "flg_$key2";
- $$output_data_ref{$key3} = "true";
- debug_print("af($key3) = $$output_data_ref{$key3}");
- }
-
- }elsif($key =~ /user__/){
- my $key2 = $key;
- $key2 =~ s/user__//;
- $$output_data_ref{$key2} = $af->{$key};
- debug_print("af($key2) = $af->{$key}");
- }
- }
- }
-
- #######################################################################
- #show_profileeditor
- #######################################################################
- sub show_profileeditor{
- my $af = shift;
- my $output_data_ref = shift;
-
- foreach my $key (sort keys %$af){
- #debug_print("set_profile_into_hash: " . $key . "=" . $af->{$key});
-
- if($key =~ /user__mode_/){
-
- }elsif($key =~ /user__/){
- my $key2 = $key;
- $key2 =~ s/user__//;
- $$output_data_ref{$key2} = $af->{$key};
- debug_print("af($key2) = $af->{$key}");
- }
- }
- }
-
- #######################################################################
- #save_profile
- #######################################################################
- sub save_profile{
- my $af = shift;
- my $cgi =shift;
- my $err="";
-
- my @param_names = $cgi->param;
-
- foreach my $param_key (@param_names){
- if($param_key ne "submit"){
- $af->{"user__$param_key"}
- = $cgi->param($param_key);
-# = Jcode->new($cgi->param($param_key),
-
- debug_print("EditProfile::save_profile: $param_key= " . Jcode::getcode($cgi->param($param_key)) . "\n");
- debug_print("EditProfile::save_profile: $param_key= [". $af->{"user__$param_key"} . "]");
-
- }
- }
-
- #XXX
- #Sanitize inputs
-
- #XXX
- #Semantics check
- $err .= check_nickname( $af->{user__nickname} );
- #$err .= ...
-
- #Save Profile
- $af->{pm}->save_profile();
-
- return($err);
- }
-
-
- #########################################################################
- # Misc routines.
- # XXX : need to be relocated.
- #########################################################################
- sub check_nickname{
- my $input = shift;
-
- if($input =~ /[^\w]/){
- return "nickname can be only alphabet characters.";
- }else{
- return "";
- }
- }
-
-}
-1;
Index: affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/EditSkins.pm
diff -u affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/EditSkins.pm:1.1.1.1 affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/EditSkins.pm:removed
--- affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/EditSkins.pm:1.1.1.1 Tue Oct 25 04:14:40 2005
+++ affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/EditSkins.pm Tue Oct 25 04:20:53 2005
@@ -1,258 +0,0 @@
-# Copyright (C) 2005 FishGrove Inc.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# $Id: EditSkins.pm,v 1.1.1.1 2005/10/24 19:14:40 slash5234 Exp $
-
-package Affelio::App::Admin::EditSkins;
-{
- use strict;
-
- use Fcntl;
- use lib("../../../../extlib/");
- use lib("../../../");
- use Affelio;
- use Affelio::misc::CGIError;
- use Affelio::misc::Debug qw(debug_print);
- use Affelio::misc::WebInput;
-
- use Exporter;
- @Affelio::App::Admin::EditSkins::ISA = "Exporter";
- @Affelio::App::Admin::EditSkins::EXPORT = qw (show choose_skin backup upload save_css);
-
- #######################################################################
- #choose_skin
- #######################################################################
- sub choose_skin{
- my $af = shift;
- my $cgi = shift;
- my $wi = new Affelio::misc::WebInput;
-
- $af->{userpref__skin} = $wi->PTN_word($cgi->param("skin_list"));
- $af->write_user_prefs();
-
- return;
- }
-
- #######################################################################
- #save_css
- #######################################################################
- sub save_css{
- my $af = shift;
- my $cgi = shift;
-
- sysopen(FILEOUT, "$af->{site__fs_root}/skins/$af->{userpref__skin}/style.css", O_WRONLY|O_TRUNC|O_CREAT, 0755);
- print FILEOUT $cgi->param("style.css");
- close(FILEOUT);
- return;
- }
-
-
- #######################################################################
- #upload
- #######################################################################
- sub upload{
- my $af = shift;
- my $cgi = shift;
- use File::Basename;
-
- my $wi = new Affelio::misc::WebInput;
-
- debug_print("EditSkins:upload: start.");
-
- ###############################
- #Enabling/disabling upload
- ###############################
- my $farm_con;
- $farm_con = $af->get_farm_connecter();
- if($farm_con){
- if($farm_con->get_val("can_upload_skin") ne "yes"){
- return();
- }
- }
-
-
- my $filename = $cgi->param('uploadingfile');
- my $filetype = $cgi->uploadInfo($filename)->{'Content-Type'};
- my $basename = ""; #basename($filename,"");
-
- my $buffer="";
- my $filecontent="";
- while(my $bytesread = read($filename, $buffer, 2048)){
- $filecontent .= $buffer;
- }
-
- my $ostype = $cgi->param('ostype');
- fileparse_set_fstype("$ostype");
-
- my $euc_filename = Jcode->new($filename)->euc;
- $euc_filename =~ s|\\|/|g;
- debug_print("EditSkins:upload: euc_filename = $euc_filename");
-
- if($euc_filename =~ /([\w\-]+\.zip)$/){
- $basename = ($1);
- }
-
- debug_print("EditSkins:upload: ostype = $ostype");
- debug_print("EditSkins:upload: filetype = $filetype");
- debug_print("EditSkins:upload: filename = $filename");
- debug_print("EditSkins:upload: basename = $basename");
-
- $ENV{'PATH'} = '/bin:/usr/bin:/usr/local/bin';
-
- if($filetype =~ /zip/ || $filename =~ /\.[zip|ZIP]$/){
- debug_print("EditSkins:upload: OK. This is a zip file. ");
- debug_print("EditSkins:upload: Extracting [$basename]...");
-
- open(FILEOUT, "> $af->{site__fs_root}/skins/$basename");
- binmode(FILEOUT);
- print(FILEOUT $filecontent);
- close(FILEOUT);
-
- system("cd $af->{site__fs_root}/skins; unzip $basename");
- system("cd $af->{site__fs_root}/skins; rm -rf $basename");
-
- debug_print("EditSkins:upload: Extracting [$basename]...DONE.");
- }else{
- debug_print("EditSkins:upload: This is a NOT zip file. [$basename]");
- debug_print("EditSkins:upload: Putting [$basename]...");
-
- open(FILEOUT, "> $af->{site__fs_root}/skins/$af->{userpref__skin}/$basename");
- binmode(FILEOUT);
- print(FILEOUT $filecontent);
- close(FILEOUT);
- }
-
- }
-
- #######################################################################
- #backup
- #######################################################################
- sub backup{
- my $af = shift;
- my $cgi = shift;
-
- my $wi = new Affelio::misc::WebInput();
-
- my $skin_name = $wi->PTN_word($cgi->param("selected_skin"));
- my $specified_name = $wi->PTN_word($cgi->param("archive_name"));
-
- debug_print("EditSkin:backup skin_name = $skin_name");
- debug_print("EditSkin:backup specified_name = $specified_name");
-
- my $archive_file_name = "";
- my $archive_dir ="";
-
- $ENV{'PATH'} = '/bin:/usr/bin:/usr/local/bin';
-
- if($specified_name ne ""){
- system("cp -rf $af->{site__fs_root}/skins/$skin_name $af->{site__fs_root}/skins/$specified_name");
- $archive_file_name = $specified_name . ".zip";
- $archive_dir = $specified_name;
- }else{
- $archive_file_name = $skin_name . ".zip";
- $archive_dir = $skin_name;
- }
-
- system("cd $af->{site__fs_root}/skins/; zip -r $archive_file_name $archive_dir");
-
- print <<__EOF__;
-Content-Type: application/octet-stream
-Content-Disposition: attachment; filename=$archive_file_name
-
-__EOF__
-#;
-
- sysopen(FILEIN, "$af->{site__fs_root}/skins/$archive_file_name", O_RDONLY);
- binmode(OUT);
- print while read FILEIN, $_, 1024;
- close FILEIN;
- close OUT;
-
- system("cd $af->{site__fs_root}/skins/; rm -rf $specified_name");
- system("cd $af->{site__fs_root}/skins/; rm -rf $archive_file_name");
- return;
- }
-
-
- #######################################################################
- #show
- #######################################################################
- sub show{
-
- my $af = shift;
- my $output_ref = shift;
-
- ###############################
- #Skin list
- ###############################
- my @skin_list=();
- my $dir;
- my $selected="";
- opendir(DIR, "$af->{site__fs_root}/skins/");
- while (defined($dir = readdir(DIR))) {
- #print "$dir\n";
- if(($dir ne '.') && ($dir ne '..') && ($dir ne 'CVS')){
-
- if($dir eq $af->{userpref__skin}){
- $selected="true";
- }else{
- $selected="";
- }
-
- push(@skin_list, {name => $dir,
- selected => $selected
- });
- }
- }
- $output_ref->{"skin_list"} = \@skin_list;
-
- ###############################
- #Enabling/disabling upload
- ###############################
- my $farm_con;
- $farm_con = $af->get_farm_connecter();
- if($farm_con){
- if($farm_con->get_val("can_upload_skin") eq "yes"){
- $output_ref->{'upload_disabler'} = "";
- }else{
- $output_ref->{'upload_disabler'} = "disabled";
- }
- }
-
- ###############################
- #Selected skin's CSS file
- ###############################
- my $css_body="";
- sysopen(IN,
- "$af->{site__fs_root}/skins/$af->{userpref__skin}/style.css",
- O_RDONLY);
- if(-w "$af->{site__fs_root}/skins/$af->{userpref__skin}/style.css"){
- $output_ref->{'current_css_mode'} = "";
- }else{
- $output_ref->{'current_css_mode'} = "readonly";
- }
-
- while(<IN>){$css_body .=$_;}
- close(IN);
- $output_ref->{'current_css_body'} = $css_body;
-
- $output_ref->{'current_skin_name'} = $af->{userpref__skin};
-
-
- }
-
-}
-1;
Index: affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/EditTemplates.pm
diff -u affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/EditTemplates.pm:1.1.1.1 affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/EditTemplates.pm:removed
--- affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/EditTemplates.pm:1.1.1.1 Tue Oct 25 04:14:40 2005
+++ affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/EditTemplates.pm Tue Oct 25 04:20:54 2005
@@ -1,248 +0,0 @@
-# Copyright (C) 2005 FishGrove Inc.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# $Id: EditTemplates.pm,v 1.1.1.1 2005/10/24 19:14:40 slash5234 Exp $
-
-package Affelio::App::Admin::EditTemplates;
-{
- use strict;
-
- use lib("../../../../extlib/");
- use lib("../../../");
- use Fcntl;
- use Affelio;
- use Affelio::misc::CGIError;
- use Affelio::misc::Debug qw(debug_print);
- use Affelio::misc::WebInput;
-
- use Exporter;
- @Affelio::App::Admin::EditTemplates::ISA = "Exporter";
- @Affelio::App::Admin::EditTemplates::EXPORT = qw (rebuild show_templates save_templates);
-
- #######################################################################
- #save_templates
- #######################################################################
- sub save_templates{
- my $af = shift;
- my $cgi = shift;
-
- sysopen(OUT, "$af->{site__user_dir}/af_templates/header.aftmpl", O_WRONLY|O_TRUNC);
- print OUT $cgi->param("header.aftmpl");
- close(OUT);
-
- sysopen(OUT, "$af->{site__user_dir}/af_templates/footer.aftmpl", O_WRONLY|O_TRUNC);
- print OUT $cgi->param("footer.aftmpl");
- close(OUT);
-
- sysopen(OUT, "$af->{site__user_dir}/af_templates/right.aftmpl", O_WRONLY|O_TRUNC);
- print OUT $cgi->param("right.aftmpl");
- close(OUT);
-
- sysopen(OUT, "$af->{site__user_dir}/af_templates/left.aftmpl", O_WRONLY|O_TRUNC);
- print OUT $cgi->param("left.aftmpl");
- close(OUT);
-
- sysopen(OUT, "$af->{site__user_dir}/af_templates/body_index.aftmpl", O_WRONLY|O_TRUNC);
- print OUT $cgi->param("body_index.aftmpl");
- close(OUT);
-
- sysopen(OUT, "$af->{site__user_dir}/af_templates/body_flist.aftmpl", O_WRONLY|O_TRUNC);
- print OUT $cgi->param("body_flist.aftmpl");
- close(OUT);
-
- sysopen(OUT, "$af->{site__user_dir}/af_templates/body_profile.aftmpl", O_WRONLY|O_TRUNC);
- print OUT $cgi->param("body_profile.aftmpl");
- close(OUT);
- }
-
-
- #######################################################################
- #rebuild
- #######################################################################
- sub rebuild{
- my $af = shift;
- my $output_data_ref = shift;
-
- my $wi = new Affelio::misc::WebInput;
-
- debug_print("rebuild: start.");
-
- ################################
- #Prep
-
- #Open the header template file in userdata dir
- my $header="";
- sysopen(HEADER, "$af->{site__user_dir}/af_templates/header.aftmpl", O_RDONLY);
- while(<HEADER>){$header .=$_;}
- close(HEADER);
-
- #Open the left template file in userdata dir
- my $left="";
- sysopen(LEFT, "$af->{site__user_dir}/af_templates/left.aftmpl", O_RDONLY);
- while(<LEFT>){$left .=$_;}
- close(LEFT);
-
- #Open the right template file in userdata dir
- my $right="";
- sysopen(RIGHT, "$af->{site__user_dir}/af_templates/right.aftmpl", O_RDONLY);
- while(<RIGHT>){$right .=$_;}
- close(RIGHT);
-
- #Open the footer template file in userdata dir
- my $footer="";
- sysopen(FOOTER, "$af->{site__user_dir}/af_templates/footer.aftmpl", O_RDONLY);
- while(<FOOTER>){$footer .=$_;}
- close(FOOTER);
-
-
- ################################
- #Main loop. For each body template....
- my $from_template_file = "";
- opendir(DIR1, "$af->{site__user_dir}/af_templates");
- while (defined($from_template_file = readdir(DIR1))) {
-
- $from_template_file = $wi->PTN_basefilename($from_template_file);
-
- if($from_template_file =~ /\.aftmpl/){
-
- debug_print("rebuild: Source file=[$from_template_file]");
-
- my $from_contents="";
- sysopen(BODY, "$af->{site__user_dir}/af_templates/$from_template_file", O_RDONLY);
- while(<BODY>){$from_contents .=$_;}
- close(BODY);
-
- my $template_name = $from_template_file;
- $template_name =~ s/\.aftmpl//g;
- if($from_template_file =~ /body.*\.aftmpl/){
- #Body template files....
- $template_name =~ s/body_//g;
- }else{
- $template_name = "_" . $template_name;
- }
-
- my $output_contents ="";
- if($from_template_file =~ /body.*\.aftmpl/){
- #Concatenate 3 files.
- $output_contents = $header . $left
- . $from_contents . $right . $footer;
- }else{
- $output_contents = $from_contents;
- }
-
- ###################################################
- #Replacement
- ###################################################
- # (1)s/AF_VAR/TMPL_VAR/g
- $output_contents =~ s/AF_VAR/TMPL_VAR/g;
-
- # (2)AF_BLOCK
- my $aftag_file;
- opendir(DIR2, "$af->{site__fs_root}/lib/Affelio/App/Admin/AFTemplateBlocks");
- while (defined($aftag_file = readdir(DIR2))) {
- #print "$aftag_file;
- if(($aftag_file ne '.') && ($aftag_file ne '..')
- && ($aftag_file ne 'CVS')){
-
- debug_print("rebuild:\taf_tag file = $aftag_file");
- my $tagname = $aftag_file;
- $tagname =~s/\.aftag//g;
- #debug_print("rebuild: Replace AF_BLOCK=$tagname");
- my $tagcontent="";
- open(TAGCONTENT,
- "$af->{site__fs_root}/lib/Affelio/App/Admin/AFTemplateBlocks/$aftag_file");
- while(<TAGCONTENT>){$tagcontent .=$_;}
- close(TAGCONTENT);
-
- my $rep = '<AF_BLOCK NAME="' . $tagname . '">';
- $output_contents =~ s/$rep/$tagcontent/g;
- }#if
- }#while
-
- ###################################################
- #Save to file in templates_dyn/ dir
- ###################################################
- sysopen(OUT, "$af->{site__fs_root}/templates_dyn/$template_name.tmpl", O_WRONLY|O_CREAT|O_TRUNC, 0755);
- print OUT $output_contents;
- close(OUT);
-
- }#if
- }#while(for each file...)
-
- $ENV{PATH} = "/bin:/usr/bin";
-
- debug_print("rebuild: header+left => Header");
- system("cat $af->{site__fs_root}/templates_dyn/_header.tmpl $af->{site__fs_root}/templates_dyn/_left.tmpl > $af->{site__fs_root}/templates_dyn/Header.tmpl");
- debug_print("rebuild: right+footer => Footer");
- system("cat $af->{site__fs_root}/templates_dyn/_right.tmpl $af->{site__fs_root}/templates_dyn/_footer.tmpl > $af->{site__fs_root}/templates_dyn/Footer.tmpl");
-
- debug_print("rebuild: end.");
- }
-
- #######################################################################
- #show_templates
- #######################################################################
- sub show_templates{
-
- my $af = shift;
- my $output_ref = shift;
-
- my $body="";
- sysopen(IN, "$af->{site__user_dir}/af_templates/header.aftmpl", O_RDONLY);
- while(<IN>){$body .=$_;}
- close(IN);
- $output_ref->{'header_template'} = $body;
-
- $body="";
- sysopen(IN, "$af->{site__user_dir}/af_templates/footer.aftmpl", O_RDONLY);
- while(<IN>){$body .=$_;}
- close(IN);
- $output_ref->{'footer_template'} = $body;
-
- $body="";
- sysopen(IN, "$af->{site__user_dir}/af_templates/left.aftmpl", O_RDONLY);
- while(<IN>){$body .=$_;}
- close(IN);
- $output_ref->{'left_template'} = $body;
-
- $body="";
- sysopen(IN, "$af->{site__user_dir}/af_templates/right.aftmpl", O_RDONLY);
- while(<IN>){$body .=$_;}
- close(IN);
- $output_ref->{'right_template'} = $body;
-
- $body="";
- sysopen(IN, "$af->{site__user_dir}/af_templates/body_index.aftmpl", O_RDONLY);
- while(<IN>){$body .=$_;}
- close(IN);
- $output_ref->{'body_template__index'} = $body;
-
- $body="";
- sysopen(IN, "$af->{site__user_dir}/af_templates/body_flist.aftmpl", O_RDONLY);
- while(<IN>){$body .=$_;}
- close(IN);
- $output_ref->{'body_template__flist'} = $body;
-
- $body="";
- sysopen(IN, "$af->{site__user_dir}/af_templates/body_profile.aftmpl", O_RDONLY);
- while(<IN>){$body .=$_;}
- close(IN);
- $output_ref->{'body_template__profile'} = $body;
-
- }
-
-}
-1;
Index: affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/FriendsGraph.pm
diff -u affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/FriendsGraph.pm:1.1.1.1 affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/FriendsGraph.pm:removed
--- affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/FriendsGraph.pm:1.1.1.1 Tue Oct 25 04:14:40 2005
+++ affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/FriendsGraph.pm Tue Oct 25 04:20:54 2005
@@ -1,123 +0,0 @@
-# Copyright (C) 2005 FishGrove Inc.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# $Id: FriendsGraph.pm,v 1.1.1.1 2005/10/24 19:14:40 slash5234 Exp $
-
-package Affelio::App::Admin::FriendsGraph;
-{
- use strict;
-
- use lib("../../../../extlib/");
- use Error qw(:try);
- use lib("../../../");
- use Affelio;
- use Affelio::misc::CGIError;
- use Affelio::SNS::Handshaker_c;
- use Affelio::misc::Debug qw(debug_print);
- use Affelio::exception::IOException;
- use Affelio::exception::DBException;
-
- use Exporter;
- @Affelio::App::Admin::FriendsGraph::ISA = "Exporter";
- @Affelio::App::Admin::FriendsGraph::EXPORT = qw (show_friendsgraph retrieve);
-
-
- #######################################################################
- #retrieve
- #######################################################################
- sub retrieve{
- my $af = shift;
-
- my @friends_list=();
- my $result = $af->{fm}->get_all_friend_list();
- my %tmp_hash;
-
- while( my @row = $result->fetchrow_array ){
- $tmp_hash{$row[1]} = $row[7];
- }
- undef($result);
-
- while (my ($peer_af_id, $last_updated) = each(%tmp_hash)) {
- debug_print("FriendsGraph::retrieve: [$peer_af_id]");
-
- ##################################################
- #Get peer's friends list.
- try{
- my $ret = get_F2List(dest_uri =>"$peer_af_id/bin/xml-rpc-serv.cgi",
- timestamp => $last_updated);
- debug_print("FriendsGraph::retrieve: \tget_F2List finished.");
- debug_print("FriendsGraph::retrieve: \t[$ret]");
-
- ##################################################
- #Save the F2 list into my DB
- $af->{fm}->save_F2List($ret, $peer_af_id);
-
- }catch Affelio::exception::IOException with{
-
- };
-
-
- }
-
- }
-
-
-
- #######################################################################
- #show_friendsgraph
- #######################################################################
- sub show_friendsgraph{
- my $af = shift;
- my $output_data_ref = shift;
-
- my $ret="";
-
- my $f1_result= $af->{fm}->get_all_friend_list();
- my @person=();
- while(@person = $f1_result->fetchrow_array) {
- # $person[0] uid
- # $person[2] nickname
- # $person[8] f2list
-
- $ret .= $af->{user__nickname} . "-" . $person[2] . ",";
-
- my @f2list_elements = split(',', $person[8]);
- foreach my $f2_uid (@f2list_elements){
- if($f2_uid ne ""){
- if($f2_uid > 0){
- #The other peer is also an F1 person.
- my $f2_nickname
- = $af->{fm}->get_attribute_by_uid($f2_uid,
- "nickname");
- $ret .= $person[2] . "-" . $f2_nickname . ",";
- }else{
- #The other peer is an F2 person.
- my $f2_nickname
- = $af->{fm}->F2_get_attribute_by_uid($f2_uid,
- "nickname");
- $ret .= $person[2] . "-" . $f2_nickname . ",";
- }
- }
- }
- }
-
- debug_print("show_FriendsGraph: edge=[$ret]");
- $$output_data_ref{edges} = $ret;
- }
-
-
-}
-1;
Index: affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/GroupMemberTable.pm
diff -u affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/GroupMemberTable.pm:1.1.1.1 affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/GroupMemberTable.pm:removed
--- affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/GroupMemberTable.pm:1.1.1.1 Tue Oct 25 04:14:40 2005
+++ affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/GroupMemberTable.pm Tue Oct 25 04:20:54 2005
@@ -1,132 +0,0 @@
-# Copyright (C) 2005 FishGrove Inc.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# $Id: GroupMemberTable.pm,v 1.1.1.1 2005/10/24 19:14:40 slash5234 Exp $
-
-package Affelio::App::Admin::GroupMemberTable;
-{
- use strict;
-
- use lib("../../../../extlib/");
- use lib("../../../");
- use Affelio;
- use Affelio::misc::CGIError;
- use Affelio::misc::Debug qw(debug_print);
- use Affelio::misc::MyCrypt qw( msg_encrypt url_encode);
-
- use Exporter;
- @Affelio::App::Admin::GroupMemberTable::ISA = "Exporter";
- @Affelio::App::Admin::GroupMemberTable::EXPORT = qw (show_GroupMember_table save_GroupMember_table);
-
-
- #####################################################################
- #save_GroupMember_table
- #####################################################################
- sub save_GroupMember_table{
- my $af = shift; #arg(1) AF
- my $q = shift; #arg(2) CGI
- my @params = $q->param;
-
- my @gid_array =();
- my @gid_uid_table =();
-
- foreach my $key (@params){
- my $value = $q->param($key);
- if($key =~ /^GRPHEADER__([0-9]*)/){
- my $this_gid =$1;
- push(@gid_array, $this_gid);
- }
- elsif($key =~ /^GRP__([0-9]*)__([0-9]*)/){
- my $this_gid =$1;
- my $this_uid =$2;
-
- push(@{$gid_uid_table[$this_gid]}, $this_uid);
- }
- }
-
- foreach my $gid (@gid_array){
- $af->{gm}->set_member_by_intarray($gid, \@{$gid_uid_table[$gid]});
- }
-
- }
-
- #####################################################################
- #show_GroupMember_table
- #####################################################################
- sub show_GroupMember_table{
- my $af = shift; #arg(1) AF
- my $output_ref = shift; #arg(3) ref of %output_data;
-
- debug_print("show_GroupMember_table: start.");
-
- #######################################################
- #Row(1): Group names
- my @group_names=();
- $output_ref->{'group_names'} = \@group_names;
-
- my $groups_SQL = $af->{gm}->get_all_group_list();
- while( (my ($gid, $group_name, $members, $option_pid, $lastupdated, $f2list) = $groups_SQL->fetchrow_array)){
-
- push(@group_names,
- {'group_name' => $group_name,
- 'gid' => "GRPHEADER__" . $gid }
- );
- }
-
- my $group_num = @group_names;
-
- #######################################################
- #Read all friends and fill all the checkbox names
- my @members=();
- $output_ref->{'members'} = \@members;
-
- my $SQL_result = $af->{fm}->get_all_friend_list();
- my @person=();
- while(@person = $SQL_result->fetchrow_array) {
- #For each friend....
- debug_print("FriendRoutines: friend=(@person)");
- #$person[0] uid
- #$person[2] nickname
-
- #Set my belonging groups
- my @my_belonging_groups=();
- for(my $i=1; $i<=$group_num; $i++){
- push(@my_belonging_groups,
- ({'checkbox_name' => "GRP__$i".'__'. $person[0],
- 'checked_flag' => ""}
- )
- );
- }
-
- #Set "checked_flag" for each belonging group
- my $SQL_result2 = $af->{gm}->get_groups_by_uid($person[0]);
- while((my $tmp_gid, my @rest) = $SQL_result2->fetchrow_array) {
- $my_belonging_groups[$tmp_gid-1]{'checked_flag'} ="checked";
- }
-
- #Set my info into "members"
- push(@members,
- ({'member_name' => $person[2],
- 'groups' => \@my_belonging_groups})
- );
- }
- }
-
-
-
-
-}#package
-1;
Index: affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/ManageApplication.pm
diff -u affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/ManageApplication.pm:1.1.1.1 affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/ManageApplication.pm:removed
--- affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/ManageApplication.pm:1.1.1.1 Tue Oct 25 04:14:40 2005
+++ affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/ManageApplication.pm Tue Oct 25 04:20:54 2005
@@ -1,202 +0,0 @@
-# Copyright (C) 2005 FishGrove Inc.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# $Id: ManageApplication.pm,v 1.1.1.1 2005/10/24 19:14:40 slash5234 Exp $
-
-package Affelio::App::Admin::ManageApplication;
-{
- use strict;
-
- use lib("../../../../extlib/");
- use lib("../../../");
- use Affelio;
- use Affelio::misc::CGIError;
- use Affelio::misc::Debug qw(debug_print);
- use Affelio::misc::MyCrypt qw( msg_encrypt url_encode);
-
- use Exporter;
- @Affelio::App::Admin::ManageApplication::ISA = "Exporter";
- @Affelio::App::Admin::ManageApplication::EXPORT = qw (manage_top show_app save_permission);
-
- #####################################################################
- #save_permission
- #####################################################################
- sub save_permission{
- my $af = shift; #arg(1) AF
- my $q = shift; #arg(2) CGI
- my $app_name = shift; #arg(e) app_name
-
- #formhead_num_action_types
- #formdata_pid(\n)_(n)
- my $num_action_types = $q->param("formhead_num_action_types");
- my $pid_list = $q->param("formhead_pid_list");
- my @pids = split('[\s]+', $pid_list);
-
- my @type_array =
- @{$af->{am}->{apps}->{$app_name}->{action_types}};
- unshift(@type_array, "DF_access");
- unshift(@type_array, "DF_visibility");
-
- foreach my $pid (@pids){
- my $type_count=0;
- for($type_count=0; $type_count<$num_action_types; $type_count++){
-
- my $param_name = "formdata_pid" . $pid . "_" . $type_count;
- my $param_value = $q->param($param_name);
- if($param_value ne ""){
- $param_value = 1;
- }else{
- $param_value = 0;
- }
- debug_print("ManageApp:save: [$pid]:[$type_array[$type_count]] = [$param_value]");
-
- $af->{am}->update_permission($app_name,
- $pid,
- $type_array[$type_count],
- $param_value);
- }
-
- } #for each
-
- }
- #####################################################################
- #show_app
- #####################################################################
- sub show_app{
- my $af = shift; #arg(1) AF
- my $app_name = shift; #arg(2) app_name
- my $output_ref = shift; #arg(3) ref of %output_data;
-
- debug_print("ManageApp::show_app: start.");
-
- $output_ref->{"install_name"} = $app_name;
- $output_ref->{"install_title"}
- = $af->{am}->{apps}->{$app_name}->{install_title};
-
- #######################
- #Headers
- #######################
- my @headers=();
- $output_ref->{"headers"} = \@headers;
-
- push(@headers, {header => '<AF_M text="DF_visibility">'});
- push(@headers, {header => '<AF_M text="DF_access">'});
-
- my $type_desc_array =
- $af->{am}->{apps}->{$app_name}->{action_types_desc};
-
- my $count=0;
- foreach my $desc (@{$type_desc_array}){
- debug_print("ManageApp::show_app: header=[$desc]");
- push(@headers, {header => "$desc"});
- $count++;
- }
- $output_ref->{"num_action_types"} = $count + 2; #gotta inlude DF 2s.
-
- #######################
- #Permission data
- #######################
- my @groups=();
- $output_ref->{"groups"} = \@groups;
-
- #prepare application permission table
- $af->{am}->prepare_app_perm_table($app_name);
-
- #Retrieve table
- my $result= $af->{am}->get_all_permission($app_name);
-
- ##################
- #For each group...
- ##################
- my $pid_list="";
- while( (my ($pid, $type, $target_id, @perms)
- = $result->fetchrow_array)){
-
- debug_print("ManageApp::show_app: data[$pid] $type, $target_id, @perms");
- my %this_group=();
- push(@groups, \%this_group);
-
- #######################
- #Group name
- if($pid==1){
- $this_group{group_name} = "<B><I>" .
- $af->{lh}->maketext("_VISITOR_TYPE_F1") . "</I></B>";
- }elsif($pid==2){
- $this_group{group_name} = "<B><I>" .
- $af->{lh}->maketext("_VISITOR_TYPE_F2") . "</I></B>";
- }elsif($pid==3){
- $this_group{group_name} = "<B><I>" .
- $af->{lh}->maketext("_VISITOR_TYPE_PB") . "</I></B>";
- }elsif($type eq "g"){
- my $query = "select group_name from AFuser_CORE_group where gid=$target_id";
- my $sth = $af->{db}->prepare($query) or die $af->{db}->errstr;
- $sth->execute() or die $af->{db}->errstr;
- my @tmp_array = $sth->fetchrow_array;
- $this_group{group_name} = $tmp_array[0];
- } #if
-
- #######################
- #Values
- my @data_array=();
- $this_group{data_array} = \@data_array;
-
- my $count=0;
- foreach my $val (@perms){
-
- my $chk_name = "formdata_pid" . $pid . "_" . $count;
- push(@data_array, {value => $val,
- checkbox_name => $chk_name});
- $count++;
- }
-
- $pid_list .= "$pid ";
- } #while (for each group)
-
- $output_ref->{"pid_list"} = $pid_list;
-
- }
-
-
- #####################################################################
- #manage_top
- #####################################################################
- sub manage_top{
- my $af = shift; #arg(1) AF
- my $output_ref = shift; #arg(2) ref of %output_data;
-
- my @applications=();
-
- my $install_name;
- my $app;
- while (($install_name, $app) = each(%{$af->{am}->{apps}})){
-
- push(@applications, {install_title => $app->{install_title},
- install_name => $app->{install_name},
- #
- editlink_URL => "$af->{site__web_root}/admin.cgi?mode=access_control_apps&mode2=show_app&app_name=$app->{install_name}",
- app_URL => "$af->{site__web_root}/apps/$app->{install_name}/$app->{guest_index}",
- #
- app_name => $app->{app_name},
- app_version => $app->{app_version}
- });
- }
-
- $output_ref->{"applications"} = \@applications;
- }
-
-
-}#package
-1;
Index: affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/ManageFriend.pm
diff -u affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/ManageFriend.pm:1.1.1.1 affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/ManageFriend.pm:removed
--- affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/ManageFriend.pm:1.1.1.1 Tue Oct 25 04:14:40 2005
+++ affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/ManageFriend.pm Tue Oct 25 04:20:54 2005
@@ -1,285 +0,0 @@
-# Copyright (C) 2005 FishGrove Inc.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# $Id: ManageFriend.pm,v 1.1.1.1 2005/10/24 19:14:40 slash5234 Exp $
-
-package Affelio::App::Admin::ManageFriend;
-{
- use strict;
-
- use lib("../../../../extlib/");
- use lib("../../../");
- use Affelio;
- use Affelio::misc::CGIError;
- use Affelio::misc::Debug qw(debug_print);
- use Affelio::misc::MyCrypt qw( msg_encrypt url_encode);
-
- use Affelio::App::FriendRoutines;
-
- use Exporter;
- @Affelio::App::Admin::ManageFriend::ISA = "Exporter";
- @Affelio::App::Admin::ManageFriend::EXPORT = qw (manage_top modify_member show_member subscribe_group unsubscribe_group remove_member);
-
- #####################################################################
- #modify_member
- #####################################################################
- sub modify_member{
- my $af = shift; #arg(1) AF
- my $uid = shift; #arg(2) uid
- my $cgi = shift; #arg(3) CGI
-
- debug_print("modify_member uid[$uid] start.");
-
- my $attr = $cgi->url_param("modified");
- my $value = $cgi->param($attr);
- debug_print("modify_member [$attr] is modified to [$value]");
-
- $af->{fm}->set_attribute_by_id($uid, $attr, $value);
-
- debug_print("modify_member uid[$uid] end.");
- }
-
- #####################################################################
- #remove_member
- #####################################################################
- sub remove_member{
- my $af = shift; #arg(1) AF
- my $uid = shift; #arg(2) uid
- my $cgi = shift; #arg(3) cgi
-
- debug_print("remove_member uid[$uid] start.");
- my $afid = $af->{fm}->get_attribute_by_uid($uid, "af_id");
-
- #Remove entry(uid) from AFuser_CORE_friends
- #Remove uid from friends of others in AFuser_CORE_friends
- #Remove entry(uid) from AFuser_CORE_friendsfriends
- #Remove uid from friends of others in AFuser_CORE_friendsfriends
- $af->{fm}->remove_friend($uid);
-
- #Remove uid from groups
- $af->{gm}->remove_person_from_all($uid);
-
- #add uid to erasedfriends
-
-
-
- debug_print("remove_member uid[$uid] end.");
- }
-
- #####################################################################
- #show_member
- #####################################################################
- sub show_member{
- my $af = shift; #arg(1) AF
- my $uid = shift; #arg(2) uid
- my $output_ref = shift; #arg(3) ref of %output_data;
-
- debug_print("show_member uid[$uid] start.");
-
- my @person = $af->{fm}->get_friend_by_uid($uid);
- # returns array(0uid, 1af_id, 2nickname, 3timestamp,
- # 4password, 5intro, 6option_pid, 7lastupdated, 8 f2list)
- debug_print("show_member [@person]");
-
- $output_ref->{"uid"} = $person[0];
-
- #Set nickname and image URL
- $output_ref->{"nickname"} = $person[2];
- my $image_URL = generate_getcontentURL($af,
- $af->{site__web_root},
- "self",
- $person[1],
- $person[4],
- "core",
- "/profile/profile_face.jpg");
-
- $output_ref->{"image_URL"} = $image_URL;
-
- #Set this friend's intro message
- $output_ref->{"intro"} = $person[5];
-
- #####################
-
- #Get attribute table
- my $attributes = $af->{pm}->get_attribute_table();
-
- #####################
- #F1
-
- #Get permission list of "F1"
- my $perm_result = $af->{perm}->get_permission("f", "f1");
- my @perm_F1 = $perm_result->fetchrow_array;
- debug_print("show_member: perm_F1=[@perm_F1]");
-
- #Set values
- my @row=();
- while(@row = $attributes->fetchrow_array){
- #debug_print("show_member: row=[@row]");
-
- my $attribute_name = $row[1];
-
- my $aid = $row[0]; #attribute ID
- my $TMPL_var_value = $perm_F1[$aid+3];
- # Why +3?
- # [0] ... Permission ID
- # [1] ... "f"
- # [2] ... "f1"
- # [3] ... perm for "nickname" which is always 1.
- # [4] ... 1st element. <=
-
- if($TMPL_var_value >= 1){
- $output_ref->{"f1_$attribute_name"} = $TMPL_var_value;
- $output_ref->{"sum_$attribute_name"} = $TMPL_var_value;
- }else{
- $output_ref->{"f1_$attribute_name"} = "";
- }
- }
-
- #####################
- #Group
-
- #Get group lists which the target friends belongs to
- my $groups_SQL = $af->{gm}->get_groups_by_uid($person[0]);
-
- my @groups_ret=();
-
- #For each group returned...
- while( (my ($gid, $group_name, $members, $option_pid)
- = $groups_SQL->fetchrow_array)){
-
- debug_print("show_member: User uid[$uid] is in group[$gid].");
- debug_print("show_member: gid=[$gid], gname=[$group_name], member=[$members], pid=[$option_pid]");
-
- if($gid <1){last;}
-
- my %this_group_ret =();
- $this_group_ret{"group_name"} = $group_name;
-
- #For each group, get the permission list.
- my $g_perm_result = $af->{perm}->get_permission("g", "$gid");
- my @g_perm = $g_perm_result->fetchrow_array;
- debug_print("show_member: group_permission=[@g_perm]");
-
- #Get attribute table
- my $attributes = $af->{pm}->get_attribute_table();
-
- #Set values
- while(my ($attr_id, $attr_name, $attr_type)
- = $attributes->fetchrow_array){
-
- if($attr_id < 0) {last;}
- #debug_print("show_member: [$attr_name]");
-
- if($g_perm[$attr_id+3] >= 1){
- $this_group_ret{$attr_name} = $g_perm[$attr_id+3];
- $output_ref->{"sum_$attr_name"} = $g_perm[$attr_id+3];
- }else{
- $this_group_ret{$attr_name} = "";
- }
- }
-
- $this_group_ret{"gid"} = $gid;
- $this_group_ret{"uid"} = $uid;
-# $this_group_ret{"tmpl_path"} = $output_ref->{tmpl_path};
- push(@groups_ret, \%this_group_ret);
-
-
- }#while
-
- $output_ref->{"groups"} = \@groups_ret;
-
- ##################################################
- #Groups that the user DOES NOT belong to
- my $add_groups_SQL = $af->{gm}->get_unsubscribing_groups_by_uid($uid);
-
- my @add_groups_ret=();
-
- #For each group returned...
- while( (my ($gid, $group_name, $members, $option_pid)
- = $add_groups_SQL->fetchrow_array)){
-
- push(@add_groups_ret, {group_name =>$group_name,
- gid => $gid}
- );
- }
- $output_ref->{"add_groups"} = \@add_groups_ret;
- }
-
-
-
- #####################################################################
- #subscribe_group
- #####################################################################
- sub subscribe_group{
- my $af = shift; #arg(1) AF
- my $gid = shift; #arg(3) GID
- my $uid = shift; #arg(2) UID
-
- debug_print("subscribe_group: start. g[$gid] u[$uid]");
-
- $af->{gm}->add_member($gid, $uid);
-
- debug_print("subscribe_group: end.");
- }
-
- #####################################################################
- #unsubscribe_group
- #####################################################################
- sub unsubscribe_group{
- my $af = shift; #arg(1) AF
- my $gid = shift; #arg(3) GID
- my $uid = shift; #arg(2) UID
-
- debug_print("unsubscribe_group: start. g[$gid] u[$uid]");
-
- $af->{gm}->remove_member($gid, $uid);
-
- debug_print("unsubscribe_group: end.");
- }
-
-
- #####################################################################
- #manage_top
- #####################################################################
- sub manage_top{
- my $af = shift; #arg(1) AF
- my $output_ref = shift; #arg(2) ref of %output_data;
-
- my @friends_list=();
- my $result = $af->{fm}->get_all_friend_list();
-
- while( my @row = $result->fetchrow_array ){
-
- my $userhome_URL = $af->{site__web_root}
- . "/outgoing.cgi?dest_url=" . $row[1];
-
- my $editlink_URL = 'admin.cgi?mode=manage_friends&mode2=show_member&uid=' . $row[0];
- my $delete_URL = 'admin.cgi?mode=manage_friends&mode2=delete&uid=' . $row[0];
-
- push(@friends_list, {nickname => $row[2],
- userhome_URL => $userhome_URL,
- editlink_URL => $editlink_URL,
- delete_URL => $delete_URL,
- tmpl_path => $output_ref->{tmpl_path}
- });
- }
-
- $output_ref->{"friends"} = \@friends_list;
- }
-
-
-}#package
-1;
Index: affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/ManageGroup.pm
diff -u affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/ManageGroup.pm:1.1.1.1 affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/ManageGroup.pm:removed
--- affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/ManageGroup.pm:1.1.1.1 Tue Oct 25 04:14:40 2005
+++ affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/ManageGroup.pm Tue Oct 25 04:20:54 2005
@@ -1,118 +0,0 @@
-# Copyright (C) 2005 FishGrove Inc.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# $Id: ManageGroup.pm,v 1.1.1.1 2005/10/24 19:14:40 slash5234 Exp $
-
-package Affelio::App::Admin::ManageGroup;
-{
- use strict;
-
- use lib("../../../../extlib/");
- use lib("../../../");
- use Affelio;
- use Affelio::misc::CGIError;
- use Affelio::misc::Debug qw(debug_print);
- use Affelio::misc::MyCrypt qw( msg_encrypt url_encode);
-
- use Exporter;
- @Affelio::App::Admin::ManageGroup::ISA = "Exporter";
- @Affelio::App::Admin::ManageGroup::EXPORT = qw (manage_top rename_group add_group remove_group);
-
- #####################################################################
- #rename_group
- #####################################################################
- sub rename_group{
- my $af = shift; #arg(1) AF
- my $gid = shift; #arg(2) gid
- my $new_name = shift; #arg(3) new_name
-
- $af->{gm}->rename_group($gid,$new_name);
- }
-
- #####################################################################
- #add_group
- #####################################################################
- sub add_group{
- my $af = shift; #arg(1) AF
- my $group_name = shift; #arg(2) new_name
-
- if($group_name eq ""){
- return;
- }
-
- debug_print("ManageGroup:add_group start.[$group_name]");
-
- #Create a new group
- my $gid = $af->{gm}->add_group($group_name);
-
- #Get attribute table
- my $attributes = $af->{pm}->get_attribute_table();
- #Set values
- my @g_perm=();
- while(my ($attr_id, $attr_name, $attr_type)
- = $attributes->fetchrow_array){
- $g_perm[$attr_id] = 0;
- }
- $g_perm[1] = 0;
-
- debug_print("ManageGroup:add_group newg group=[@g_perm]");
- $af->{perm}->add_permission("g", $gid, \@g_perm);
- }
-
- #####################################################################
- #remove_group
- #####################################################################
- sub remove_group{
- my $af = shift; #arg(1) AF
- my $gid = shift; #arg(2) gid
- my $q = shift; #arg(3) CGI
-
- $af->{gm}->remove_group($gid);
- }
-
-
- #####################################################################
- #manage_top
- #####################################################################
- sub manage_top{
- my $af = shift; #arg(1) AF
- my $output_ref = shift; #arg(2) ref of %output_data;
-
- my @friends_list=();
- my $result = $af->{gm}->get_all_group_list();
-
- while( my @row = $result->fetchrow_array ){
-
- my $group_attr_URL = 'admin.cgi?mode=access_control';
- my $group_member_URL = 'admin.cgi?mode=group_member_table';
- my $removelink_URL = 'admin.cgi?mode=manage_groups&mode2=remove_group&gid=' . $row[0];
- my $rename_URL = 'admin.cgi?mode=manage_groups&mode2=rename&gid=' . $row[0];
-
- push(@friends_list, {group_name => $row[1],
- rename_URL => $rename_URL,
- group_attr_URL => $group_attr_URL,
- group_member_URL => $group_member_URL,
- removelink_URL => $removelink_URL,
-# tmpl_path => $output_ref->{tmpl_path}
- });
- }
-
- $output_ref->{"friends"} = \@friends_list;
- }
-
-
-}#package
-1;
Index: affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/Messaging.pm
diff -u affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/Messaging.pm:1.1.1.1 affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/Messaging.pm:removed
--- affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/Messaging.pm:1.1.1.1 Tue Oct 25 04:14:40 2005
+++ affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/Messaging.pm Tue Oct 25 04:20:54 2005
@@ -1,308 +0,0 @@
-# Copyright (C) 2005 FishGrove Inc.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# $Id: Messaging.pm,v 1.1.1.1 2005/10/24 19:14:40 slash5234 Exp $
-
-package Affelio::App::Admin::Messaging;
-{
- use strict;
-
- use lib("../../../../extlib/");
- use Error qw(:try);
- use MIME::Base64::Perl;
- use lib("../../../");
- use Affelio;
- use Affelio::misc::CGIError;
- use Affelio::misc::Debug qw(debug_print);
- use Affelio::misc::Encoding qw(db_encode db_decode);
- use Affelio::misc::Time qw(timestamp2string get_timestamp);
- use Affelio::misc::WebInput;
- use Affelio::SNS::Handshaker_c;
- use Affelio::exception::CommunicationException;
-
- use Exporter;
- @Affelio::App::Admin::Messaging::ISA = "Exporter";
- @Affelio::App::Admin::Messaging::EXPORT = qw (show_message_list show_message mark_as_read get_new compose send_message);
-
- #######################################################################
- #send_message
- #######################################################################
- sub send_message{
- my $af = shift;
- my $cgi = shift;
-
- debug_print("Mesg::send: start.");
-
- my $msg_to = $cgi->param("msg_to");
- my $msg_title = $cgi->param("msg_title");
- my $msg_body = $cgi->param("msg_body");
-
- debug_print("Mesg::send: $msg_to $msg_title $msg_body");
-
- my $passAB = $af->{fm}->get_attribute_by_afid($msg_to, "password");
- if(!defined($passAB) || $passAB eq ""){
- #Exception!
- exit(1);
- }
- debug_print("Mesg::send: passAB=[$passAB]");
-
- my $ret="";
- try{
- $ret = post_Message(dest_uri => "$msg_to/bin/xml-rpc-serv.cgi",
- src => $af->{site__web_root},
- password => $passAB,
- msg_from => $af->{site__web_root},
- msg_from_nickname => $af->{user__nickname},
- msg_to => $msg_to,
- msg_timestamp => get_timestamp(),
- msg_title => $msg_title,
- msg_body => $msg_body);
- }catch Affelio::exception::NetworkException with{
- my $E = shift;
- throw Affelio::exception::CommunicationException($E);
-
- }catch Affelio::exception::InvalidInputException with{
- my $E = shift;
- error($cgi, "<PRE>Exception: " . $E . "</PRE>");
- };
- }
-
-
- #######################################################################
- #compose
- #######################################################################
- sub compose{
- my $af = shift;
- my $cgi = shift;
- my $output_ref = shift;
- my $wi = new Affelio::misc::WebInput;
-
- my $reply_to = $cgi->param("reply_to");
- my $reply_title = $cgi->param("reply_title");
- my $reply_body = $cgi->param("reply_body");
-
- debug_print("Messaging::compose: start.");
- debug_print("Messaging::compose: Reply-To: [$reply_to]");
-
- ############################
- #To:
- ############################
- my @friends_list=();
- my $result = $af->{fm}->get_all_friend_list();
- while( my @row = $result->fetchrow_array ){
-
- my $selected = "";
- if($row[1] eq $reply_to){
- $selected ="selected";
- }
-
- push(@friends_list, {nickname => $row[2],
- afid => $row[1],
- selected => $selected});
- debug_print("Messaging::\t$row[2]");
- }
- $output_ref->{"friends"} = \@friends_list;
-
- ############################
- #Title:
- ############################
- $output_ref->{"msg_title"} = $reply_title;
-
- ############################
- #Body:
- ############################
- $output_ref->{"msg_body"} = $reply_body;
-
-
- debug_print("Messaging::compose: end.");
- }
-
- #######################################################################
- #mark_as_read
- #######################################################################
- sub mark_as_read{
- my $wi = new Affelio::misc::WebInput;
-
- my $af = shift;
- my $mid = shift;
- $mid = $wi->PTN_num($mid);
-
- debug_print("marK_as_read: start");
-
- my $ret= $af->{mesgm}->mark_as_read($mid);
-
- debug_print("marK_as_read: end");
- }
-
- #######################################################################
- #get_new
- #######################################################################
- sub get_new{
- my $af = shift;
- debug_print("get_new: start");
-
- my $ret= $af->{mesgm}->get_unread_message_num();
-
- debug_print("get_new: end");
- return($ret);
- }
-
-
- #######################################################################
- #show_message
- #######################################################################
- sub show_message{
- my $wi = new Affelio::misc::WebInput;
-
- my $af = shift;
- my $mid = shift;
- $mid = $wi->PTN_num($mid);
- my $output_ref = shift;
-
- debug_print("show_message: start.");
-
- my @message= $af->{mesgm}->retrieve_message($mid);
- my ($msg_mid, $msg_timestamp, $msg_title, $msg_type,
- $msg_from, $msg_body, $msg_readflag) = @message;
-
- if($msg_type=~ /Encode\-Base64/){
- $msg_body = decode_base64($msg_body);
- }
- debug_print("show_message: $msg_from $msg_title $msg_type $msg_body");
-
- $msg_timestamp = timestamp2string($msg_timestamp);
-
- if($msg_type=~ /UserToUser/){
- my $reply_title = "Re: $msg_title";
- my $reply_body = $msg_body;
- $reply_body =~ s/\r\n/\n/g;
- $reply_body =~ s/\r/\n/g;
- $reply_body =~ s/\n/\n>>/g;
- $reply_body = "\r\n>>" . $reply_body;
-
- my $reply_to="";
- if($msg_from =~ /HREF="(.+)">/){
- $reply_to = $1;
- }
-
- my $reply_HTML = <<EOT;
-<FORM METHOD="POST" ACTION="admin.cgi?mode=messages&action=compose">
-<INPUT TYPE="hidden" NAME="reply_to" VALUE="$reply_to">
-<INPUT TYPE="hidden" NAME="reply_title" VALUE="$reply_title">
-<INPUT TYPE="hidden" NAME="reply_body" VALUE="$reply_body">
-<INPUT TYPE="submit" VALUE="<AF_M text="Reply">">
-</FORM>
-EOT
- $$output_ref{"reply_HTML"} = $reply_HTML;
-
- }
-
- #URL ---> <A HREF="URL">URL</A>
- $msg_body = $wi->translate_URL_to_HTML($msg_body);
- #\n ----> <BR>
- $msg_body =~ s/\r\n/\n/g;
- $msg_body =~ s/\r/\n/g;
- $msg_body =~ s/\n/<BR>/g;
-
- ###############
- #UserToUser (inter-Affelio massaging
- ###############
- #XXX
- # This part is quite nasty. Since $msg_from is using format
- # like '<A HREF="url">nickname</A>' due to a weird DB problem,
- # We have to change the URL to the one through outgoing.cgi
- # by using ad-hoc regexes....
- if($msg_type =~ /UserToUser/){
- $msg_from =~ /<A HREF="(.*)">(.+)<\/A>/;
- debug_print("show_message_list: \t[$1]");
- debug_print("show_message_list: \t[$2]");
-
- $msg_from = '<A HREF="' . $af->{site__web_root} . '/outgoing.cgi?dest_url=' . $1 . '" target="_blank">' . $2 . '</A>';
- }
- ###########
-
-
- $$output_ref{"msg_timestamp"} = $msg_timestamp;
- $$output_ref{"msg_title"} = $msg_title;
- $$output_ref{"msg_from"} = $msg_from;
- $$output_ref{"msg_body"} = $msg_body;
-
- $$output_ref{"url2list"} = "$af->{site__web_root}/admin.cgi?mode=messages";
-
- debug_print("show_message: end.");
- }
-
- #######################################################################
- #show_message_list
- #######################################################################
- sub show_message_list{
- my $af = shift;
- my $output_ref = shift;
-
- debug_print("show_message_list: start.");
-
- my @ret_messages=();
- $output_ref->{'messages'} = \@ret_messages;
-
- my $messages= $af->{mesgm}->retrieve_all_messages();
-
- my @message=();
- while(@message = $messages->fetchrow_array) {
- my ($msg_mid, $msg_timestamp, $msg_title, $msg_type,
- $msg_from, $msg_body, $msg_readflag) = @message;
-
- $msg_timestamp = timestamp2string($msg_timestamp);
-
- debug_print("show_message_list: [$msg_title]");
- debug_print("show_message_list: [$msg_from]");
- debug_print("show_message_list: [$msg_body]");
- debug_print("show_message_list: [$msg_timestamp]");
-
- ###############
- #UserToUser (inter-Affelio massaging
- ###############
- #XXX
- # This part is quite nasty. Since $msg_from is using format
- # like '<A HREF="url">nickname</A>' due to a weird DB problem,
- # We have to change the URL to the one through outgoing.cgi
- # by using ad-hoc regexes....
- if($msg_type =~ /UserToUser/){
- $msg_from =~ /<A HREF="(.*)">(.+)<\/A>/;
- debug_print("show_message_list: \t[$1]");
- debug_print("show_message_list: \t[$2]");
-
- $msg_from = '<A HREF="' . $af->{site__web_root} . '/outgoing.cgi?dest_url=' . $1 . '" target="_blank">' . $2 . '</A>';
- }
- ###########
-
-
- my $linkurl = "$af->{site__web_root}/admin.cgi?mode=messages&action=show&mid=$msg_mid";
- push(@ret_messages,
- {
- 'msg_title' => $msg_title,
- 'msg_from' => $msg_from,
- 'msg_timestamp' => $msg_timestamp,
- 'readflag' => $msg_readflag,
- 'msg_linkurl' => $linkurl
- }
- );
- }
- debug_print("show_message_list: end.");
- }
-
-
-}
-1;
Index: affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/MyStatus.pm
diff -u affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/MyStatus.pm:1.1.1.1 affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/MyStatus.pm:removed
--- affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/MyStatus.pm:1.1.1.1 Tue Oct 25 04:14:40 2005
+++ affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/MyStatus.pm Tue Oct 25 04:20:54 2005
@@ -1,52 +0,0 @@
-# Copyright (C) 2005 FishGrove Inc.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# $Id: MyStatus.pm,v 1.1.1.1 2005/10/24 19:14:40 slash5234 Exp $
-
-package Affelio::App::Admin::MyStatus;
-{
- use strict;
-
- use lib("../../../../extlib/");
- use lib("../../../");
- use Affelio;
- use Affelio::misc::CGIError;
- use Affelio::misc::Debug qw(debug_print);
- use Affelio::misc::WebInput qw(delete_HTML);
-
- use Exporter;
- @Affelio::App::Admin::MyStatus::ISA = "Exporter";
- @Affelio::App::Admin::MyStatus::EXPORT = qw (post);
-
- #######################################################################
- #post
- #######################################################################
- sub post{
- my $af = shift;
- my $currentstatus = shift;
-
- debug_print("MyStatus::post start [$currentstatus]");
-
- $af->{user__currentstatus} = $currentstatus;
-
- $af->{pm}->save_profile();
-
- debug_print("MyStatus::post end");
- }
-
-
-}
-1;
Index: affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/SendHandshake.pm
diff -u affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/SendHandshake.pm:1.1.1.1 affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/SendHandshake.pm:removed
--- affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/SendHandshake.pm:1.1.1.1 Tue Oct 25 04:14:40 2005
+++ affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/SendHandshake.pm Tue Oct 25 04:20:54 2005
@@ -1,131 +0,0 @@
-# Copyright (C) 2005 FishGrove Inc.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# $Id: SendHandshake.pm,v 1.1.1.1 2005/10/24 19:14:40 slash5234 Exp $
-
-package Affelio::App::Admin::SendHandshake;
-{
- use strict;
-
- use lib("../../../../extlib/");
- use Error qw(:try);
- use Crypt::DH;
- use MIME::Base64::Perl;
- use lib("../../../");
- use Affelio;
- use Affelio::misc::CGIError;
- use Affelio::misc::Debug qw(debug_print);
- use Affelio::misc::Encoding qw(db_encode db_decode);
- use Affelio::misc::Time qw(timestamp2string get_timestamp);
- use Affelio::misc::WebInput;
- use Affelio::SNS::Handshaker_c;
- use Affelio::SNS::Handshaker_tmpDB;
- use Affelio::exception::CommunicationException;
-
- use Exporter;
- @Affelio::App::Admin::SendHandshake::ISA = "Exporter";
- @Affelio::App::Admin::SendHandshake::EXPORT = qw (send);
-
- #######################################################################
- #send
- #######################################################################
- sub send{
- my $af = shift;
- my $cgi = shift;
- my $output_ref = shift;
- my $wi = new Affelio::misc::WebInput;
-
- debug_print("SendHandshake::send: start.");
-
- my $dest_uri = $wi->PTN_URL($cgi->param("dest_uri"));
- my $my_mesg = $cgi->param("my_mesg");
-
- debug_print("SendHandshake::send: $dest_uri");
- debug_print("SendHandshake::send: $my_mesg");
-
- ######################
- #Remove "/" from the end of $dest_uri
- ######################
- $dest_uri =~ s/\/$//;
- my $dest_xml_uri = $dest_uri . "/bin/xml-rpc-serv.cgi";
- debug_print("SendHandshake::send: $dest_xml_uri\n");
-
- ###########################################
- # Get current time;
- my $cur_time = get_timestamp();
-
- ###########################################
- #DH key generation
- my $mydh = Crypt::DH->new;
- #RFC 2412 - The OAKLEY Key Determination Protocol
- #Group 1: A 768 bit prime
- my $DH_g="2";
- my $DH_p="1552518092300708935130918131258481755631334049434514313202351194902966239949102107258669453876591642442910007680288864229150803718918046342632727613031282983744380820890196288509170691316593175367469551763119843371637221007210577919";
- $mydh->g($DH_g);
- $mydh->p($DH_p);
-
- #Step (1): create my public_key
- $mydh->generate_keys;
- my $my_DH_pub_key_str = $mydh->pub_key->bstr;
- my $my_DH_pri_key_str = $mydh->priv_key->bstr;
-
- debug_print("SendHandshake::send: pri_key = $my_DH_pri_key_str [" . length($my_DH_pri_key_str) . "]digits");
- debug_print("SendHandshake::send: pub_key = $my_DH_pub_key_str [" . length($my_DH_pub_key_str) . "]digits");
-
-
- ###########################################
- # Send HandShake to the URL
- ###########################################
- my $ret="";
- try{
- $ret = send_HandShake(dest_uri => $dest_xml_uri,
- timestamp => $cur_time,
- my_nickname => $af->{user__nickname},
- my_AFID => $af->{site__web_root},
- DH_pub_key_str => $my_DH_pub_key_str,
- mesg => $my_mesg);
- }catch Affelio::exception::NetworkException with{
- my $E = shift;
- throw Affelio::exception::CommunicationException($E);
- }catch Affelio::exception::Exception with{
- my $E = shift;
- throw Affelio::exception::CommunicationException($E);
- };
- if($ret->{flerror} == 1){
- #XML-RPC communication was successful.
- #But the peer returned error. denyetc...
- throw Affelio::exception::CommunicationException($@);
- }
-
- ###########################################
- # Save peer's info into pending_DB
- ###########################################
- my $tmpdb= new Affelio::SNS::Handshaker_tmpDB($af);
- $tmpdb->add_sent_Handshake($cur_time,
- $dest_xml_uri,
- "",
- $cur_time,
- $my_DH_pri_key_str);
- debug_print("SendHandshake::send: wrote DB $dest_uri => $cur_time\n");
-
- $output_ref->{target_url} = $dest_uri;
- $output_ref->{mypage_url} = "$af->{site__web_root}/admin.cgi";
-
- return;
- }
-
-}
-1;
Index: affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/SendInvitation.pm
diff -u affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/SendInvitation.pm:1.1.1.1 affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/SendInvitation.pm:removed
--- affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/SendInvitation.pm:1.1.1.1 Tue Oct 25 04:14:40 2005
+++ affelio_farm/admin/skelton/affelio/lib/Affelio/App/Admin/SendInvitation.pm Tue Oct 25 04:20:54 2005
@@ -1,77 +0,0 @@
-# Copyright (C) 2005 FishGrove Inc.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# $Id: SendInvitation.pm,v 1.1.1.1 2005/10/24 19:14:40 slash5234 Exp $
-
-package Affelio::App::Admin::SendInvitation;
-{
- use strict;
-
- use lib("../../../../extlib/");
- use lib("../../../");
- use Affelio;
- use Affelio::misc::CGIError;
- use Affelio::misc::Debug qw(debug_print);
-
- use Exporter;
- @Affelio::App::Admin::SendInvitation::ISA = "Exporter";
- @Affelio::App::Admin::SendInvitation::EXPORT = qw (send_invitation);
-
- #####################################################################
- #send_invitation
- #####################################################################
- sub send_invitation{
- my $af = shift;
- my $dest_address = shift; #arg(2) destination address
- my $output_ref = shift; #arg(3) ref of %output_data;
-
- debug_print("send_invitation: start. dest=[$dest_address]");
-
- my $encoded_subject = "Invitation to Affelio";
-
- my $TMPL_FILE = "$af->{site__fs_root}/templates/" .
- "$af->{site__template}/invitation_email.tmpl";
- my $emailbody = `cat $TMPL_FILE`;
-
- $emailbody =~ s/\[TO_ADDR\]/$dest_address/g;
- $emailbody =~ s/\[FROM_NICKNAME\]/$af->{user__nickname}/g;
- $emailbody =~ s/\[FROM_ADDR\]/$af->{user__email1}/g;
- $emailbody =~ s/\[FROM_URL\]/$af->{site__web_root}/g;
-
- my $intro_url= "http://www.handshaker.jp/?from="
- . $af->{site__web_root} . "&preferred="
- . $af->{userpref__preferred_hosting_service};
-
- $emailbody =~ s/\[INTRO_URL\]/$intro_url/g;
-
-
- open(MAIL, " | $af->{cmd__nkf} -j | $af->{cmd__sendmail} -t ");
- print MAIL "To: $dest_address\n";
- print MAIL "From: $af->{user__email1}\n";
- print MAIL "Subject: $encoded_subject\n";
- print MAIL "Content-Type: text/plain; charset=iso-2022-jp\n";
- print MAIL "MIME-Version: 1.0\n\n";
- print MAIL $emailbody;
- close(MAIL);
-
- #Set notice message
- $output_ref->{'notice'} = "Email sent to $dest_address";
-
- debug_print("send_invitation: end.");
- }
-
-}#package
-1;