| 1 | #!/usr/bin/perl -w | ||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||
| 3 | package Apache::Sling::User; | ||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||
| 5 | 2 | ▶ | use 5.008001; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 6 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 7 | 2 | ▶ | use warnings; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 8 | 2 | ▶ | use Carp; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 9 | 2 | ▶ | use Text::CSV; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 10 | 2 | ▶ | use Getopt::Long qw(:config bundling); | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 11 | 2 | ▶ | use Apache::Sling; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 12 | 2 | ▶ | use Apache::Sling::Print; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 13 | 2 | ▶ | use Apache::Sling::Request; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 14 | 2 | ▶ | use Apache::Sling::UserUtil; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||
| 16 | 2 | require Exporter; | |||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||
| 18 | 2 | ▶ | use base qw(Exporter); | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||
| 20 | 2 | our @EXPORT_OK = qw(command_line); | |||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||
| 22 | 2 | our $VERSION = '0.27'; | |||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||
| 24 | #{{{sub new | ||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||
| 26 | 2 | ▶ | sub new { | ||||||||||||||||||||||||||||
|
Subroutine
new: called CC=3 SCAR=11.3
Pod
documented
| |||||||||||||||||||||||||||||||
| 27 | 2 | my ( $class, $authn, $verbose, $log ) = @_; | |||||||||||||||||||||||||||||
| 28 | 0 | ▶ | if ( !defined $authn ) { croak 'no authn provided!'; } | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 29 | 2 | my $response; | |||||||||||||||||||||||||||||
| 30 | 2 | ▶ | $verbose = ( defined $verbose ? $verbose : 0 ); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 31 | my $user = { | ||||||||||||||||||||||||||||||
| 32 | 2 | BaseURL => ${$authn}->{'BaseURL'}, | |||||||||||||||||||||||||||||
| 33 | Authn => $authn, | ||||||||||||||||||||||||||||||
| 34 | Message => q{}, | ||||||||||||||||||||||||||||||
| 35 | Response => \$response, | ||||||||||||||||||||||||||||||
| 36 | Verbose => $verbose, | ||||||||||||||||||||||||||||||
| 37 | Log => $log | ||||||||||||||||||||||||||||||
| 38 | }; | ||||||||||||||||||||||||||||||
| 39 | 2 | bless $user, $class; | |||||||||||||||||||||||||||||
| 40 | 2 | return $user; | |||||||||||||||||||||||||||||
| 41 | } | ||||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||||
| 43 | #}}} | ||||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||||
| 45 | #{{{sub set_results | ||||||||||||||||||||||||||||||
| 46 | 1 | ▶ | sub set_results { | ||||||||||||||||||||||||||||
|
Subroutine
set_results: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||
| 47 | 1 | my ( $user, $message, $response ) = @_; | |||||||||||||||||||||||||||||
| 48 | 1 | $user->{'Message'} = $message; | |||||||||||||||||||||||||||||
| 49 | 1 | $user->{'Response'} = $response; | |||||||||||||||||||||||||||||
| 50 | 1 | return 1; | |||||||||||||||||||||||||||||
| 51 | } | ||||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||||
| 53 | #}}} | ||||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||||
| 55 | #{{{sub add | ||||||||||||||||||||||||||||||
| 56 | 1 | ▶ | sub add { | ||||||||||||||||||||||||||||
|
Subroutine
add: called CC=2 SCAR=13.6
Pod
documented
| |||||||||||||||||||||||||||||||
| 57 | 1 | my ( $user, $act_on_user, $act_on_pass, $properties ) = @_; | |||||||||||||||||||||||||||||
| 58 | my $res = Apache::Sling::Request::request( | ||||||||||||||||||||||||||||||
| 59 | \$user, | ||||||||||||||||||||||||||||||
| 60 | Apache::Sling::UserUtil::add_setup( | ||||||||||||||||||||||||||||||
| 61 | 1 | $user->{'BaseURL'}, $act_on_user, $act_on_pass, $properties | |||||||||||||||||||||||||||||
| 62 | ) | ||||||||||||||||||||||||||||||
| 63 | ); | ||||||||||||||||||||||||||||||
| 64 | 0 | my $success = Apache::Sling::UserUtil::add_eval($res); | |||||||||||||||||||||||||||||
| 65 | 0 | my $message = "User: \"$act_on_user\" "; | |||||||||||||||||||||||||||||
| 66 | 0 | ▶ | $message .= ( $success ? 'added!' : 'was not added!' ); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 67 | 0 | $user->set_results( "$message", $res ); | |||||||||||||||||||||||||||||
| 68 | 0 | return $success; | |||||||||||||||||||||||||||||
| 69 | } | ||||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||||
| 71 | #}}} | ||||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||||
| 73 | #{{{sub add_from_file | ||||||||||||||||||||||||||||||
| 74 | 3 | ▶ | sub add_from_file { | ||||||||||||||||||||||||||||
|
Subroutine
add_from_file: called CC=15 SCAR=41.4
Pod
documented
| |||||||||||||||||||||||||||||||
| 75 | 3 | my ( $user, $file, $fork_id, $number_of_forks ) = @_; | |||||||||||||||||||||||||||||
| 76 | 3 | ▶ | $fork_id = defined $fork_id ? $fork_id : 0; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 77 | 3 | ▶ | $number_of_forks = defined $number_of_forks ? $number_of_forks : 1; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 78 | 3 | my $csv = Text::CSV->new(); | |||||||||||||||||||||||||||||
| 79 | 3 | my $count = 0; | |||||||||||||||||||||||||||||
| 80 | 3 | my $number_of_columns = 0; | |||||||||||||||||||||||||||||
| 81 | 3 | my @column_headings; | |||||||||||||||||||||||||||||
| 82 | 3 | ▶ | if ( !defined $file ) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 83 | 1 | croak 'File to upload from not defined'; | |||||||||||||||||||||||||||||
| 84 | } | ||||||||||||||||||||||||||||||
| 85 | 2 | ▶ | if ( open my ($input), '<', $file ) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 86 | 1 | ▶ | while (<$input>) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 87 | 1 | ▶ | if ( $count++ == 0 ) { | ||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||
| 88 | |||||||||||||||||||||||||||||||
| 89 | # Parse file column headings first to determine field names: | ||||||||||||||||||||||||||||||
| 90 | 1 | ▶ | if ( $csv->parse($_) ) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 91 | 1 | @column_headings = $csv->fields(); | |||||||||||||||||||||||||||||
| 92 | |||||||||||||||||||||||||||||||
| 93 | # First field must be site: | ||||||||||||||||||||||||||||||
| 94 | 1 | ▶ | if ( $column_headings[0] !~ /^[Uu][Ss][Ee][Rr]$/msx ) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 95 | 1 | croak | |||||||||||||||||||||||||||||
| 96 | 'First CSV column must be the user ID, column heading must be "user". Found: "' | ||||||||||||||||||||||||||||||
| 97 | . $column_headings[0] . "\".\n"; | ||||||||||||||||||||||||||||||
| 98 | } | ||||||||||||||||||||||||||||||
| 99 | 0 | ▶ | if ( $column_headings[1] !~ | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 100 | /^[Pp][Aa][Ss][Ss][Ww][Oo][Rr][Dd]$/msx ) | ||||||||||||||||||||||||||||||
| 101 | { | ||||||||||||||||||||||||||||||
| 102 | 0 | croak | |||||||||||||||||||||||||||||
| 103 | 'Second CSV column must be the user password, column heading must be "password". Found: "' | ||||||||||||||||||||||||||||||
| 104 | . $column_headings[1] . "\".\n"; | ||||||||||||||||||||||||||||||
| 105 | } | ||||||||||||||||||||||||||||||
| 106 | 0 | $number_of_columns = @column_headings; | |||||||||||||||||||||||||||||
| 107 | } | ||||||||||||||||||||||||||||||
| 108 | else { | ||||||||||||||||||||||||||||||
| 109 | 0 | croak 'CSV broken, failed to parse line: ' | |||||||||||||||||||||||||||||
| 110 | . $csv->error_input; | ||||||||||||||||||||||||||||||
| 111 | } | ||||||||||||||||||||||||||||||
| 112 | } | ||||||||||||||||||||||||||||||
| 113 | elsif ( $fork_id == ( $count++ % $number_of_forks ) ) { | ||||||||||||||||||||||||||||||
| 114 | 0 | my @properties; | |||||||||||||||||||||||||||||
| 115 | 0 | ▶ | if ( $csv->parse($_) ) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 116 | 0 | my @columns = $csv->fields(); | |||||||||||||||||||||||||||||
| 117 | 0 | my $columns_size = @columns; | |||||||||||||||||||||||||||||
| 118 | |||||||||||||||||||||||||||||||
| 119 | # Check row has same number of columns as there were column headings: | ||||||||||||||||||||||||||||||
| 120 | 0 | ▶ | if ( $columns_size != $number_of_columns ) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 121 | 0 | croak | |||||||||||||||||||||||||||||
| 122 | "Found \"$columns_size\" columns. There should have been \"$number_of_columns\".\nRow contents was: $_"; | ||||||||||||||||||||||||||||||
| 123 | } | ||||||||||||||||||||||||||||||
| 124 | 0 | my $id = $columns[0]; | |||||||||||||||||||||||||||||
| 125 | 0 | my $password = $columns[1]; | |||||||||||||||||||||||||||||
| 126 | 0 | ▶ | for ( my $i = 2 ; $i < $number_of_columns ; $i++ ) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 127 | 0 | my $heading = $column_headings[$i]; | |||||||||||||||||||||||||||||
| 128 | 0 | my $data = $columns[$i]; | |||||||||||||||||||||||||||||
| 129 | 0 | my $value = "$heading=$data"; | |||||||||||||||||||||||||||||
| 130 | 0 | push @properties, $value; | |||||||||||||||||||||||||||||
| 131 | } | ||||||||||||||||||||||||||||||
| 132 | 0 | $user->add( $id, $password, \@properties ); | |||||||||||||||||||||||||||||
| 133 | 0 | Apache::Sling::Print::print_result($user); | |||||||||||||||||||||||||||||
| 134 | } | ||||||||||||||||||||||||||||||
| 135 | else { | ||||||||||||||||||||||||||||||
| 136 | 0 | croak q{CSV broken, failed to parse line: } | |||||||||||||||||||||||||||||
| 137 | . $csv->error_input; | ||||||||||||||||||||||||||||||
| 138 | } | ||||||||||||||||||||||||||||||
| 139 | } | ||||||||||||||||||||||||||||||
| 140 | } | ||||||||||||||||||||||||||||||
| 141 | 0 | ▶ | close $input or croak q{Problem closing input}; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 142 | } | ||||||||||||||||||||||||||||||
| 143 | else { | ||||||||||||||||||||||||||||||
| 144 | 1 | croak "Problem opening file: '$file'"; | |||||||||||||||||||||||||||||
| 145 | } | ||||||||||||||||||||||||||||||
| 146 | 0 | return 1; | |||||||||||||||||||||||||||||
| 147 | } | ||||||||||||||||||||||||||||||
| 148 | |||||||||||||||||||||||||||||||
| 149 | #}}} | ||||||||||||||||||||||||||||||
| 150 | |||||||||||||||||||||||||||||||
| 151 | #{{{sub change_password | ||||||||||||||||||||||||||||||
| 152 | 1 | ▶ | sub change_password { | ||||||||||||||||||||||||||||
|
Subroutine
change_password: called CC=2 SCAR=13.6
Pod
documented
| |||||||||||||||||||||||||||||||
| 153 | 1 | my ( $user, $act_on_user, $act_on_pass, $new_pass, $new_pass_confirm ) = @_; | |||||||||||||||||||||||||||||
| 154 | my $res = Apache::Sling::Request::request( | ||||||||||||||||||||||||||||||
| 155 | \$user, | ||||||||||||||||||||||||||||||
| 156 | Apache::Sling::UserUtil::change_password_setup( | ||||||||||||||||||||||||||||||
| 157 | 1 | $user->{'BaseURL'}, $act_on_user, $act_on_pass, | |||||||||||||||||||||||||||||
| 158 | $new_pass, $new_pass_confirm | ||||||||||||||||||||||||||||||
| 159 | ) | ||||||||||||||||||||||||||||||
| 160 | ); | ||||||||||||||||||||||||||||||
| 161 | 0 | my $success = Apache::Sling::UserUtil::change_password_eval($res); | |||||||||||||||||||||||||||||
| 162 | 0 | my $message = "User: \"$act_on_user\" "; | |||||||||||||||||||||||||||||
| 163 | 0 | ▶ | $message .= ( $success ? 'password changed!' : 'password not changed!' ); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 164 | 0 | $user->set_results( "$message", $res ); | |||||||||||||||||||||||||||||
| 165 | 0 | return $success; | |||||||||||||||||||||||||||||
| 166 | } | ||||||||||||||||||||||||||||||
| 167 | |||||||||||||||||||||||||||||||
| 168 | #}}} | ||||||||||||||||||||||||||||||
| 169 | |||||||||||||||||||||||||||||||
| 170 | #{{{sub check_exists | ||||||||||||||||||||||||||||||
| 171 | 1 | ▶ | sub check_exists { | ||||||||||||||||||||||||||||
|
Subroutine
check_exists: called CC=2 SCAR=13.6
Pod
documented
| |||||||||||||||||||||||||||||||
| 172 | 1 | my ( $user, $act_on_user ) = @_; | |||||||||||||||||||||||||||||
| 173 | my $res = Apache::Sling::Request::request( | ||||||||||||||||||||||||||||||
| 174 | \$user, | ||||||||||||||||||||||||||||||
| 175 | Apache::Sling::UserUtil::exists_setup( | ||||||||||||||||||||||||||||||
| 176 | 1 | $user->{'BaseURL'}, $act_on_user | |||||||||||||||||||||||||||||
| 177 | ) | ||||||||||||||||||||||||||||||
| 178 | ); | ||||||||||||||||||||||||||||||
| 179 | 0 | my $success = Apache::Sling::UserUtil::exists_eval($res); | |||||||||||||||||||||||||||||
| 180 | 0 | my $message = "User \"$act_on_user\" "; | |||||||||||||||||||||||||||||
| 181 | 0 | ▶ | $message .= ( $success ? 'exists!' : 'does not exist!' ); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 182 | 0 | $user->set_results( "$message", $res ); | |||||||||||||||||||||||||||||
| 183 | 0 | return $success; | |||||||||||||||||||||||||||||
| 184 | } | ||||||||||||||||||||||||||||||
| 185 | |||||||||||||||||||||||||||||||
| 186 | #}}} | ||||||||||||||||||||||||||||||
| 187 | |||||||||||||||||||||||||||||||
| 188 | #{{{ sub command_line | ||||||||||||||||||||||||||||||
| 189 | 0 | ▶ | sub command_line { | ||||||||||||||||||||||||||||
|
Subroutine
command_line: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||
| 190 | 0 | my ( $user, @ARGV ) = @_; | |||||||||||||||||||||||||||||
| 191 | 0 | my $sling = Apache::Sling->new; | |||||||||||||||||||||||||||||
| 192 | 0 | my $config = $user->config( $sling, @ARGV ); | |||||||||||||||||||||||||||||
| 193 | 0 | return $user->run( $sling, $config ); | |||||||||||||||||||||||||||||
| 194 | } | ||||||||||||||||||||||||||||||
| 195 | |||||||||||||||||||||||||||||||
| 196 | #}}} | ||||||||||||||||||||||||||||||
| 197 | |||||||||||||||||||||||||||||||
| 198 | #{{{sub config | ||||||||||||||||||||||||||||||
| 199 | |||||||||||||||||||||||||||||||
| 200 | 1 | ▶ | sub config { | ||||||||||||||||||||||||||||
|
Subroutine
config: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||||||||||||||||||||||
| 201 | 1 | my ( $user, $sling, @ARGV ) = @_; | |||||||||||||||||||||||||||||
| 202 | |||||||||||||||||||||||||||||||
| 203 | 1 | my $user_config = $user->config_hash( $sling, @ARGV ); | |||||||||||||||||||||||||||||
| 204 | |||||||||||||||||||||||||||||||
| 205 | 1 | ▶ | GetOptions( | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 206 | $user_config, 'auth=s', | ||||||||||||||||||||||||||||||
| 207 | 'help|?', 'log|L=s', | ||||||||||||||||||||||||||||||
| 208 | 'man|M', 'pass|p=s', | ||||||||||||||||||||||||||||||
| 209 | 'threads|t=s', 'url|U=s', | ||||||||||||||||||||||||||||||
| 210 | 'user|u=s', 'verbose|v+', | ||||||||||||||||||||||||||||||
| 211 | 'add|a=s', 'additions|A=s', | ||||||||||||||||||||||||||||||
| 212 | 'change-password|c=s', 'delete|d=s', | ||||||||||||||||||||||||||||||
| 213 | 'email|E=s', 'first-name|f=s', | ||||||||||||||||||||||||||||||
| 214 | 'exists|e=s', 'last-name|l=s', | ||||||||||||||||||||||||||||||
| 215 | 'new-password|n=s', 'password|w=s', | ||||||||||||||||||||||||||||||
| 216 | 'property|P=s', 'update=s', | ||||||||||||||||||||||||||||||
| 217 | 'view|V=s' | ||||||||||||||||||||||||||||||
| 218 | ) or $user->help(); | ||||||||||||||||||||||||||||||
| 219 | |||||||||||||||||||||||||||||||
| 220 | 1 | return $user_config; | |||||||||||||||||||||||||||||
| 221 | } | ||||||||||||||||||||||||||||||
| 222 | |||||||||||||||||||||||||||||||
| 223 | #}}} | ||||||||||||||||||||||||||||||
| 224 | |||||||||||||||||||||||||||||||
| 225 | #{{{sub config_hash | ||||||||||||||||||||||||||||||
| 226 | |||||||||||||||||||||||||||||||
| 227 | 1 | ▶ | sub config_hash { | ||||||||||||||||||||||||||||
|
Subroutine
config_hash: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||
| 228 | 1 | my ( $user, $sling, @ARGV ) = @_; | |||||||||||||||||||||||||||||
| 229 | 1 | my $password; | |||||||||||||||||||||||||||||
| 230 | my $additions; | ||||||||||||||||||||||||||||||
| 231 | 1 | my $add; | |||||||||||||||||||||||||||||
| 232 | 1 | my $change_password; | |||||||||||||||||||||||||||||
| 233 | 1 | my $delete; | |||||||||||||||||||||||||||||
| 234 | 1 | my $email; | |||||||||||||||||||||||||||||
| 235 | 1 | my $exists; | |||||||||||||||||||||||||||||
| 236 | 1 | my $first_name; | |||||||||||||||||||||||||||||
| 237 | 1 | my $last_name; | |||||||||||||||||||||||||||||
| 238 | 1 | my $new_password; | |||||||||||||||||||||||||||||
| 239 | 1 | my @property; | |||||||||||||||||||||||||||||
| 240 | 1 | my $update; | |||||||||||||||||||||||||||||
| 241 | 1 | my $view; | |||||||||||||||||||||||||||||
| 242 | |||||||||||||||||||||||||||||||
| 243 | my %user_config = ( | ||||||||||||||||||||||||||||||
| 244 | 'auth' => \$sling->{'Auth'}, | ||||||||||||||||||||||||||||||
| 245 | 'help' => \$sling->{'Help'}, | ||||||||||||||||||||||||||||||
| 246 | 'log' => \$sling->{'Log'}, | ||||||||||||||||||||||||||||||
| 247 | 'man' => \$sling->{'Man'}, | ||||||||||||||||||||||||||||||
| 248 | 'pass' => \$sling->{'Pass'}, | ||||||||||||||||||||||||||||||
| 249 | 'threads' => \$sling->{'Threads'}, | ||||||||||||||||||||||||||||||
| 250 | 'url' => \$sling->{'URL'}, | ||||||||||||||||||||||||||||||
| 251 | 'user' => \$sling->{'User'}, | ||||||||||||||||||||||||||||||
| 252 | 1 | 'verbose' => \$sling->{'Verbose'}, | |||||||||||||||||||||||||||||
| 253 | 'add' => \$add, | ||||||||||||||||||||||||||||||
| 254 | 'additions' => \$additions, | ||||||||||||||||||||||||||||||
| 255 | 'change-password' => \$change_password, | ||||||||||||||||||||||||||||||
| 256 | 'delete' => \$delete, | ||||||||||||||||||||||||||||||
| 257 | 'email' => \$email, | ||||||||||||||||||||||||||||||
| 258 | 'exists' => \$exists, | ||||||||||||||||||||||||||||||
| 259 | 'first-name' => \$first_name, | ||||||||||||||||||||||||||||||
| 260 | 'last-name' => \$last_name, | ||||||||||||||||||||||||||||||
| 261 | 'new-password' => \$new_password, | ||||||||||||||||||||||||||||||
| 262 | 'password' => \$password, | ||||||||||||||||||||||||||||||
| 263 | 'property' => \@property, | ||||||||||||||||||||||||||||||
| 264 | 'update' => \$update, | ||||||||||||||||||||||||||||||
| 265 | 'view' => \$view | ||||||||||||||||||||||||||||||
| 266 | ); | ||||||||||||||||||||||||||||||
| 267 | |||||||||||||||||||||||||||||||
| 268 | 1 | return \%user_config; | |||||||||||||||||||||||||||||
| 269 | } | ||||||||||||||||||||||||||||||
| 270 | |||||||||||||||||||||||||||||||
| 271 | #}}} | ||||||||||||||||||||||||||||||
| 272 | |||||||||||||||||||||||||||||||
| 273 | #{{{sub del | ||||||||||||||||||||||||||||||
| 274 | 1 | ▶ | sub del { | ||||||||||||||||||||||||||||
|
Subroutine
del: called CC=2 SCAR=13.6
Pod
documented
| |||||||||||||||||||||||||||||||
| 275 | 1 | my ( $user, $act_on_user ) = @_; | |||||||||||||||||||||||||||||
| 276 | my $res = Apache::Sling::Request::request( | ||||||||||||||||||||||||||||||
| 277 | \$user, | ||||||||||||||||||||||||||||||
| 278 | Apache::Sling::UserUtil::delete_setup( | ||||||||||||||||||||||||||||||
| 279 | 1 | $user->{'BaseURL'}, $act_on_user | |||||||||||||||||||||||||||||
| 280 | ) | ||||||||||||||||||||||||||||||
| 281 | ); | ||||||||||||||||||||||||||||||
| 282 | 0 | my $success = Apache::Sling::UserUtil::delete_eval($res); | |||||||||||||||||||||||||||||
| 283 | 0 | my $message = "User: \"$act_on_user\" "; | |||||||||||||||||||||||||||||
| 284 | 0 | ▶ | $message .= ( $success ? 'deleted!' : 'was not deleted!' ); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 285 | 0 | $user->set_results( "$message", $res ); | |||||||||||||||||||||||||||||
| 286 | 0 | return $success; | |||||||||||||||||||||||||||||
| 287 | } | ||||||||||||||||||||||||||||||
| 288 | |||||||||||||||||||||||||||||||
| 289 | #}}} | ||||||||||||||||||||||||||||||
| 290 | |||||||||||||||||||||||||||||||
| 291 | #{{{ sub help | ||||||||||||||||||||||||||||||
| 292 | 1 | ▶ | sub help { | ||||||||||||||||||||||||||||
|
Subroutine
help: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||
| 293 | |||||||||||||||||||||||||||||||
| 294 | 1 | print <<"EOF"; | |||||||||||||||||||||||||||||
| 295 | Usage: perl $0 [-OPTIONS [-MORE_OPTIONS]] [--] [PROGRAM_ARG1 ...] | ||||||||||||||||||||||||||||||
| 296 | The following options are accepted: | ||||||||||||||||||||||||||||||
| 297 | |||||||||||||||||||||||||||||||
| 298 | --add or -a (actOnUser) - add specified user name. | ||||||||||||||||||||||||||||||
| 299 | --additions or -A (file) - file containing list of users to be added. | ||||||||||||||||||||||||||||||
| 300 | --auth (type) - Specify auth type. If ommitted, default is used. | ||||||||||||||||||||||||||||||
| 301 | --change-password or -c (actOnUser) - change password of specified user name. | ||||||||||||||||||||||||||||||
| 302 | --delete or -d (actOnUser) - delete specified user name. | ||||||||||||||||||||||||||||||
| 303 | --email or -E (email) - specify email address property for user. | ||||||||||||||||||||||||||||||
| 304 | --exists or -e (actOnUser) - check whether specified user exists. | ||||||||||||||||||||||||||||||
| 305 | --first-name or -f (firstName) - specify first name property for user. | ||||||||||||||||||||||||||||||
| 306 | --help or -? - view the script synopsis and options. | ||||||||||||||||||||||||||||||
| 307 | --last-name or -l (lastName) - specify last name property for user. | ||||||||||||||||||||||||||||||
| 308 | --log or -L (log) - Log script output to specified log file. | ||||||||||||||||||||||||||||||
| 309 | --man or -M - view the full script documentation. | ||||||||||||||||||||||||||||||
| 310 | --me or -m - me returns json representing authenticated user. | ||||||||||||||||||||||||||||||
| 311 | --new-password or -n (newPassword) - Used with -c, new password to set. | ||||||||||||||||||||||||||||||
| 312 | --password or -w (actOnPass) - Password of user being actioned. | ||||||||||||||||||||||||||||||
| 313 | --pass or -p (password) - Password of user performing actions. | ||||||||||||||||||||||||||||||
| 314 | --property or -P (property=value) - Specify property to set on user. | ||||||||||||||||||||||||||||||
| 315 | --threads or -t (threads) - Used with -A, defines number of parallel | ||||||||||||||||||||||||||||||
| 316 | processes to have running through file. | ||||||||||||||||||||||||||||||
| 317 | --update (actOnUser) - update specified user name, used with -P. | ||||||||||||||||||||||||||||||
| 318 | --url or -U (URL) - URL for system being tested against. | ||||||||||||||||||||||||||||||
| 319 | --user or -u (username) - Name of user to perform any actions as. | ||||||||||||||||||||||||||||||
| 320 | --verbose or -v or -vv or -vvv - Increase verbosity of output. | ||||||||||||||||||||||||||||||
| 321 | --view or -V (actOnUser) - view details for specified user in json format. | ||||||||||||||||||||||||||||||
| 322 | |||||||||||||||||||||||||||||||
| 323 | Options may be merged together. -- stops processing of options. | ||||||||||||||||||||||||||||||
| 324 | Space is not required between options and their arguments. | ||||||||||||||||||||||||||||||
| 325 | For full details run: perl $0 --man | ||||||||||||||||||||||||||||||
| 326 | EOF | ||||||||||||||||||||||||||||||
| 327 | |||||||||||||||||||||||||||||||
| 328 | 1 | return 1; | |||||||||||||||||||||||||||||
| 329 | } | ||||||||||||||||||||||||||||||
| 330 | |||||||||||||||||||||||||||||||
| 331 | #}}} | ||||||||||||||||||||||||||||||
| 332 | |||||||||||||||||||||||||||||||
| 333 | #{{{ sub man | ||||||||||||||||||||||||||||||
| 334 | 0 | ▶ | sub man { | ||||||||||||||||||||||||||||
|
Subroutine
man: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||
| 335 | |||||||||||||||||||||||||||||||
| 336 | 0 | my ($user) = @_; | |||||||||||||||||||||||||||||
| 337 | |||||||||||||||||||||||||||||||
| 338 | 0 | print <<'EOF'; | |||||||||||||||||||||||||||||
| 339 | user perl script. Provides a means of managing users in sling from the command | ||||||||||||||||||||||||||||||
| 340 | line. The script also acts as a reference implementation for the User perl | ||||||||||||||||||||||||||||||
| 341 | library. | ||||||||||||||||||||||||||||||
| 342 | |||||||||||||||||||||||||||||||
| 343 | EOF | ||||||||||||||||||||||||||||||
| 344 | |||||||||||||||||||||||||||||||
| 345 | 0 | $user->help(); | |||||||||||||||||||||||||||||
| 346 | |||||||||||||||||||||||||||||||
| 347 | 0 | print <<"EOF"; | |||||||||||||||||||||||||||||
| 348 | Example Usage | ||||||||||||||||||||||||||||||
| 349 | |||||||||||||||||||||||||||||||
| 350 | * Add user "testuser" with password "test" | ||||||||||||||||||||||||||||||
| 351 | |||||||||||||||||||||||||||||||
| 352 | perl $0 -U http://localhost:8080 -a testuser -w test | ||||||||||||||||||||||||||||||
| 353 | |||||||||||||||||||||||||||||||
| 354 | * View information about authenticated user "testuser" | ||||||||||||||||||||||||||||||
| 355 | |||||||||||||||||||||||||||||||
| 356 | perl $0 -U http://localhost:8080 --me -u testuser -p test | ||||||||||||||||||||||||||||||
| 357 | |||||||||||||||||||||||||||||||
| 358 | * Authenticate as admin and check whether user "testuser" exists | ||||||||||||||||||||||||||||||
| 359 | |||||||||||||||||||||||||||||||
| 360 | perl $0 -U http://localhost:8080 -e testuser -u admin -p admin | ||||||||||||||||||||||||||||||
| 361 | |||||||||||||||||||||||||||||||
| 362 | * Authenticate and update "testuser" to set property p1=v1 | ||||||||||||||||||||||||||||||
| 363 | |||||||||||||||||||||||||||||||
| 364 | perl $0 -U http://localhost:8080 --update testuser -P "p1=v1" -u admin -p admin | ||||||||||||||||||||||||||||||
| 365 | |||||||||||||||||||||||||||||||
| 366 | * Authenticate and delete "testuser" | ||||||||||||||||||||||||||||||
| 367 | |||||||||||||||||||||||||||||||
| 368 | perl $0 -U http://localhost:8080 -d testuser -u admin -p admin | ||||||||||||||||||||||||||||||
| 369 | EOF | ||||||||||||||||||||||||||||||
| 370 | |||||||||||||||||||||||||||||||
| 371 | 0 | return 1; | |||||||||||||||||||||||||||||
| 372 | } | ||||||||||||||||||||||||||||||
| 373 | |||||||||||||||||||||||||||||||
| 374 | #}}} | ||||||||||||||||||||||||||||||
| 375 | |||||||||||||||||||||||||||||||
| 376 | #{{{sub run | ||||||||||||||||||||||||||||||
| 377 | 2 | ▶ | sub run { | ||||||||||||||||||||||||||||
|
Subroutine
run: called CC=19 SCAR=47.1
Pod
documented
| |||||||||||||||||||||||||||||||
| 378 | 2 | my ( $user, $sling, $config ) = @_; | |||||||||||||||||||||||||||||
| 379 | 2 | ▶ | if ( !defined $config ) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 380 | 1 | croak 'No user config supplied!'; | |||||||||||||||||||||||||||||
| 381 | } | ||||||||||||||||||||||||||||||
| 382 | 1 | $sling->check_forks; | |||||||||||||||||||||||||||||
| 383 | my $authn = | ||||||||||||||||||||||||||||||
| 384 | defined $sling->{'Authn'} | ||||||||||||||||||||||||||||||
| 385 | 1 | ▶ | ? ${ $sling->{'Authn'} } | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 386 | : new Apache::Sling::Authn( \$sling ); | ||||||||||||||||||||||||||||||
| 387 | |||||||||||||||||||||||||||||||
| 388 | # Handle the three special case commonly used properties: | ||||||||||||||||||||||||||||||
| 389 | 1 | ▶ | if ( defined ${ $config->{'email'} } ) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 390 | 0 | push @{ $config->{'property'} }, "email=" . ${ $config->{'email'} }; | |||||||||||||||||||||||||||||
| 391 | } | ||||||||||||||||||||||||||||||
| 392 | 1 | ▶ | if ( defined ${ $config->{'first-name'} } ) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 393 | 0 | push @{ $config->{'property'} }, | |||||||||||||||||||||||||||||
| 394 | 0 | "firstName=" . ${ $config->{'first-name'} }; | |||||||||||||||||||||||||||||
| 395 | } | ||||||||||||||||||||||||||||||
| 396 | 1 | ▶ | if ( defined ${ $config->{'last-name'} } ) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 397 | 0 | push @{ $config->{'property'} }, | |||||||||||||||||||||||||||||
| 398 | 0 | "lastName=" . ${ $config->{'last-name'} }; | |||||||||||||||||||||||||||||
| 399 | } | ||||||||||||||||||||||||||||||
| 400 | |||||||||||||||||||||||||||||||
| 401 | 1 | my $success = 1; | |||||||||||||||||||||||||||||
| 402 | |||||||||||||||||||||||||||||||
| 403 | 0 | ▶ | if ( $sling->{'Help'} ) { $user->help(); } | ||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||
| 404 | 0 | elsif ( $sling->{'Man'} ) { $user->man(); } | |||||||||||||||||||||||||||||
| 405 | 1 | elsif ( defined ${ $config->{'additions'} } ) { | |||||||||||||||||||||||||||||
| 406 | my $message = | ||||||||||||||||||||||||||||||
| 407 | 0 | "Adding users from file \"" . ${ $config->{'additions'} } . "\":\n"; | |||||||||||||||||||||||||||||
| 408 | 0 | Apache::Sling::Print::print_with_lock( "$message", $sling->{'Log'} ); | |||||||||||||||||||||||||||||
| 409 | 0 | my @childs = (); | |||||||||||||||||||||||||||||
| 410 | 0 | for my $i ( 0 .. $sling->{'Threads'} ) { | |||||||||||||||||||||||||||||
| 411 | 0 | my $pid = fork; | |||||||||||||||||||||||||||||
| 412 | 0 | ▶ | if ($pid) { push @childs, $pid; } # parent | ||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||
| 413 | elsif ( $pid == 0 ) { # child | ||||||||||||||||||||||||||||||
| 414 | # Create a new separate user agent per fork in order to | ||||||||||||||||||||||||||||||
| 415 | # ensure cookie stores are separate, then log the user in: | ||||||||||||||||||||||||||||||
| 416 | 0 | $authn->{'LWP'} = $authn->user_agent( $sling->{'Referer'} ); | |||||||||||||||||||||||||||||
| 417 | 0 | $authn->login_user(); | |||||||||||||||||||||||||||||
| 418 | my $user = | ||||||||||||||||||||||||||||||
| 419 | new Apache::Sling::User( \$authn, $sling->{'Verbose'}, | ||||||||||||||||||||||||||||||
| 420 | 0 | $sling->{'Log'} ); | |||||||||||||||||||||||||||||
| 421 | 0 | $user->add_from_file( ${ $config->{'additions'} }, | |||||||||||||||||||||||||||||
| 422 | 0 | $i, $sling->{'Threads'} ); | |||||||||||||||||||||||||||||
| 423 | 0 | exit 0; | |||||||||||||||||||||||||||||
| 424 | } | ||||||||||||||||||||||||||||||
| 425 | else { | ||||||||||||||||||||||||||||||
| 426 | 0 | croak "Could not fork $i!"; | |||||||||||||||||||||||||||||
| 427 | } | ||||||||||||||||||||||||||||||
| 428 | } | ||||||||||||||||||||||||||||||
| 429 | 0 | foreach (@childs) { waitpid $_, 0; } | |||||||||||||||||||||||||||||
| 430 | } | ||||||||||||||||||||||||||||||
| 431 | else { | ||||||||||||||||||||||||||||||
| 432 | 1 | $authn->login_user(); | |||||||||||||||||||||||||||||
| 433 | 1 | ▶ | if ( defined ${ $config->{'exists'} } ) { | ||||||||||||||||||||||||||||
|
Branch: 6 branches
| |||||||||||||||||||||||||||||||
| 434 | $user = | ||||||||||||||||||||||||||||||
| 435 | new Apache::Sling::User( \$authn, $sling->{'Verbose'}, | ||||||||||||||||||||||||||||||
| 436 | 0 | $sling->{'Log'} ); | |||||||||||||||||||||||||||||
| 437 | 0 | $success = $user->check_exists( ${ $config->{'exists'} } ); | |||||||||||||||||||||||||||||
| 438 | } | ||||||||||||||||||||||||||||||
| 439 | 1 | elsif ( defined ${ $config->{'add'} } ) { | |||||||||||||||||||||||||||||
| 440 | $user = | ||||||||||||||||||||||||||||||
| 441 | new Apache::Sling::User( \$authn, $sling->{'Verbose'}, | ||||||||||||||||||||||||||||||
| 442 | 0 | $sling->{'Log'} ); | |||||||||||||||||||||||||||||
| 443 | $success = $user->add( | ||||||||||||||||||||||||||||||
| 444 | 0 | ${ $config->{'add'} }, | |||||||||||||||||||||||||||||
| 445 | 0 | ${ $config->{'password'} }, | |||||||||||||||||||||||||||||
| 446 | 0 | $config->{'property'} | |||||||||||||||||||||||||||||
| 447 | ); | ||||||||||||||||||||||||||||||
| 448 | } | ||||||||||||||||||||||||||||||
| 449 | 1 | elsif ( defined ${ $config->{'update'} } ) { | |||||||||||||||||||||||||||||
| 450 | $user = | ||||||||||||||||||||||||||||||
| 451 | new Apache::Sling::User( \$authn, $sling->{'Verbose'}, | ||||||||||||||||||||||||||||||
| 452 | 0 | $sling->{'Log'} ); | |||||||||||||||||||||||||||||
| 453 | $success = | ||||||||||||||||||||||||||||||
| 454 | 0 | $user->update( ${ $config->{'update'} }, $config->{'property'} ); | |||||||||||||||||||||||||||||
| 455 | } | ||||||||||||||||||||||||||||||
| 456 | 1 | elsif ( defined ${ $config->{'change-password'} } ) { | |||||||||||||||||||||||||||||
| 457 | $user = | ||||||||||||||||||||||||||||||
| 458 | new Apache::Sling::User( \$authn, $sling->{'Verbose'}, | ||||||||||||||||||||||||||||||
| 459 | 0 | $sling->{'Log'} ); | |||||||||||||||||||||||||||||
| 460 | $success = $user->change_password( | ||||||||||||||||||||||||||||||
| 461 | 0 | ${ $config->{'change-password'} }, | |||||||||||||||||||||||||||||
| 462 | 0 | ${ $config->{'password'} }, | |||||||||||||||||||||||||||||
| 463 | 0 | ${ $config->{'new-password'} }, | |||||||||||||||||||||||||||||
| 464 | 0 | ${ $config->{'new-password'} } | |||||||||||||||||||||||||||||
| 465 | ); | ||||||||||||||||||||||||||||||
| 466 | } | ||||||||||||||||||||||||||||||
| 467 | 1 | elsif ( defined ${ $config->{'delete'} } ) { | |||||||||||||||||||||||||||||
| 468 | $user = | ||||||||||||||||||||||||||||||
| 469 | new Apache::Sling::User( \$authn, $sling->{'Verbose'}, | ||||||||||||||||||||||||||||||
| 470 | 0 | $sling->{'Log'} ); | |||||||||||||||||||||||||||||
| 471 | 0 | $success = $user->del( ${ $config->{'delete'} } ); | |||||||||||||||||||||||||||||
| 472 | } | ||||||||||||||||||||||||||||||
| 473 | 1 | elsif ( defined ${ $config->{'view'} } ) { | |||||||||||||||||||||||||||||
| 474 | $user = | ||||||||||||||||||||||||||||||
| 475 | new Apache::Sling::User( \$authn, $sling->{'Verbose'}, | ||||||||||||||||||||||||||||||
| 476 | 0 | $sling->{'Log'} ); | |||||||||||||||||||||||||||||
| 477 | 0 | $success = $user->view( ${ $config->{'view'} } ); | |||||||||||||||||||||||||||||
| 478 | } | ||||||||||||||||||||||||||||||
| 479 | else { | ||||||||||||||||||||||||||||||
| 480 | 1 | $user->help(); | |||||||||||||||||||||||||||||
| 481 | 1 | return 1; | |||||||||||||||||||||||||||||
| 482 | } | ||||||||||||||||||||||||||||||
| 483 | 0 | Apache::Sling::Print::print_result($user); | |||||||||||||||||||||||||||||
| 484 | } | ||||||||||||||||||||||||||||||
| 485 | 0 | return $success; | |||||||||||||||||||||||||||||
| 486 | } | ||||||||||||||||||||||||||||||
| 487 | |||||||||||||||||||||||||||||||
| 488 | #}}} | ||||||||||||||||||||||||||||||
| 489 | |||||||||||||||||||||||||||||||
| 490 | #{{{sub update | ||||||||||||||||||||||||||||||
| 491 | 1 | ▶ | sub update { | ||||||||||||||||||||||||||||
|
Subroutine
update: called CC=2 SCAR=13.6
Pod
documented
| |||||||||||||||||||||||||||||||
| 492 | 1 | my ( $user, $act_on_user, $properties ) = @_; | |||||||||||||||||||||||||||||
| 493 | my $res = Apache::Sling::Request::request( | ||||||||||||||||||||||||||||||
| 494 | \$user, | ||||||||||||||||||||||||||||||
| 495 | Apache::Sling::UserUtil::update_setup( | ||||||||||||||||||||||||||||||
| 496 | 1 | $user->{'BaseURL'}, $act_on_user, $properties | |||||||||||||||||||||||||||||
| 497 | ) | ||||||||||||||||||||||||||||||
| 498 | ); | ||||||||||||||||||||||||||||||
| 499 | 0 | my $success = Apache::Sling::UserUtil::update_eval($res); | |||||||||||||||||||||||||||||
| 500 | 0 | my $message = "User: \"$act_on_user\" "; | |||||||||||||||||||||||||||||
| 501 | 0 | ▶ | $message .= ( $success ? 'updated!' : 'was not updated!' ); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 502 | 0 | $user->set_results( "$message", $res ); | |||||||||||||||||||||||||||||
| 503 | 0 | return $success; | |||||||||||||||||||||||||||||
| 504 | } | ||||||||||||||||||||||||||||||
| 505 | |||||||||||||||||||||||||||||||
| 506 | #}}} | ||||||||||||||||||||||||||||||
| 507 | |||||||||||||||||||||||||||||||
| 508 | #{{{sub view | ||||||||||||||||||||||||||||||
| 509 | 1 | ▶ | sub view { | ||||||||||||||||||||||||||||
|
Subroutine
view: called CC=2 SCAR=13.6
Pod
documented
| |||||||||||||||||||||||||||||||
| 510 | 1 | my ( $user, $act_on_user ) = @_; | |||||||||||||||||||||||||||||
| 511 | my $res = Apache::Sling::Request::request( | ||||||||||||||||||||||||||||||
| 512 | \$user, | ||||||||||||||||||||||||||||||
| 513 | Apache::Sling::UserUtil::exists_setup( | ||||||||||||||||||||||||||||||
| 514 | 1 | $user->{'BaseURL'}, $act_on_user | |||||||||||||||||||||||||||||
| 515 | ) | ||||||||||||||||||||||||||||||
| 516 | ); | ||||||||||||||||||||||||||||||
| 517 | 0 | my $success = Apache::Sling::UserUtil::exists_eval($res); | |||||||||||||||||||||||||||||
| 518 | my $message = ( | ||||||||||||||||||||||||||||||
| 519 | $success | ||||||||||||||||||||||||||||||
| 520 | 0 | ▶ | ? ${$res}->content | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 521 | : "Problem viewing user: \"$act_on_user\"" | ||||||||||||||||||||||||||||||
| 522 | ); | ||||||||||||||||||||||||||||||
| 523 | 0 | $user->set_results( "$message", $res ); | |||||||||||||||||||||||||||||
| 524 | 0 | return $success; | |||||||||||||||||||||||||||||
| 525 | } | ||||||||||||||||||||||||||||||
| 526 | |||||||||||||||||||||||||||||||
| 527 | #}}} | ||||||||||||||||||||||||||||||
| 528 | |||||||||||||||||||||||||||||||
| 529 | 2 | 1; | |||||||||||||||||||||||||||||
| 530 | |||||||||||||||||||||||||||||||
| 531 | __END__ | ||||||||||||||||||||||||||||||