Changeset 1023 for trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql.pm
- Timestamp:
- 05/29/12 10:25:51 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql.pm
r983 r1023 60 60 $self->{_db} && $self->{_db}->rollback; 61 61 } 62 63 =head2 db 64 65 Return a L<DBI> handle over database, load it if need. 66 67 =cut 62 68 63 69 sub db { … … 84 90 $self->{_db}->do(q{set DATESTYLE to 'DMY'}); 85 91 $self->log(LA_DEBUG, 'New connection to DB'); 92 $self->{_db}->commit; 86 93 return $self->{_db}; 87 94 } … … 153 160 } 154 161 155 156 # Extra non standard functions 162 =head1 SPECIFICS FUNCTIONS 163 164 =head2 get_global_value ($varname) 165 166 Return global value set into base 167 168 =cut 157 169 158 170 sub get_global_value { … … 167 179 $res->{val} 168 180 } 181 182 =head2 set_global_value ($varname, $value) 183 184 Set global value. 185 186 =cut 169 187 170 188 sub set_global_value { … … 181 199 } 182 200 201 =head2 generate_rsa_key ($password) 202 203 Return public and private peer rsa keys 204 205 =cut 206 183 207 sub generate_rsa_key { 184 208 my ($self, $password) = @_; … … 195 219 } 196 220 221 =head2 private_key ($password) 222 223 Load and return private rsa key 224 225 =cut 226 197 227 sub private_key { 198 228 my ($self, $password) = @_; … … 204 234 $privkey 205 235 } 236 237 =head2 get_rsa_password 238 239 Return hash with peer username => encryptedPassword 240 241 =cut 206 242 207 243 sub get_rsa_password { … … 221 257 } 222 258 259 =head2 store_rsa_key ($public, $private) 260 261 Store public and private RSA key info data base 262 263 =cut 264 223 265 sub store_rsa_key { 224 266 my ($self, $public, $private) = @_; … … 231 273 } 232 274 275 =head2 find_next_expire_users ($expire) 276 277 Search user expiring in C<$expire> delay 278 279 =cut 233 280 234 281 sub find_next_expire_users { … … 252 299 } 253 300 301 =head2 find_expired_users ($expire) 302 303 Return list of user going to expires in C<$expire> delay 304 305 =cut 306 254 307 sub find_expired_users { 255 308 my ($self, $expire) = @_; … … 271 324 } 272 325 326 =head2 rename_nethost ($nethostname, $to, %options) 327 328 Facility function to rename computer to new name 329 330 =cut 331 273 332 sub rename_nethost { 274 333 my ($self, $nethostname, $to, %options) = @_; … … 287 346 return 1; 288 347 } 348 349 =head2 nethost_exchange_ip ($ip1, $ip2) 350 351 Exchange ip1 with ip2 in base 352 353 =cut 289 354 290 355 sub nethost_exchange_ip { … … 316 381 } 317 382 383 =head1 ATTRIBUTES FUNCTIONS 384 385 =head2 register_attribute ($otype, $attribute, $comment) 386 387 Register a new attribute in base 388 389 =cut 390 318 391 sub register_attribute { 319 392 my ($self, $otype, $attribute, $comment) = @_; … … 322 395 } 323 396 397 =head2 is_registered_attribute ($otype, $attribute) 398 399 Return true is attribute already exists 400 401 =cut 402 324 403 sub is_registered_attribute { 325 404 my ($self, $otype, $attribute) = @_; … … 328 407 } 329 408 409 =head2 get_attribute_comment ($otype, $attribute) 410 411 Return the comment associated to attribute 412 413 =cut 414 330 415 sub get_attribute_comment { 331 416 my ($self, $otype, $attribute) = @_; … … 334 419 } 335 420 421 =head2 set_attribute_comment ($otype, $attribute, $comment) 422 423 Set comment to attribute 424 425 =cut 426 336 427 sub set_attribute_comment { 337 428 my ($self, $otype, $attribute, $comment) = @_; … … 340 431 } 341 432 342 sub check_user_manager {433 sub _check_user_manager { 343 434 $_[0]->_handle_by_unexported('user', 'manager', 'active'); 344 435 } 345 436 346 sub check_group_manager {437 sub _check_group_manager { 347 438 $_[0]->_handle_by_unexported('group', 'managedBy'); 348 439 } 349 440 350 sub check_nethost_owner {441 sub _check_nethost_owner { 351 442 $_[0]->_handle_by_unexported('nethost', 'owner', 'active'); 352 443 } … … 372 463 } 373 464 465 =head2 get_datarequest ($id) 466 467 Return user request C<$id> 468 469 =cut 470 374 471 sub get_datarequest { 375 472 my ($self, $id) = @_; … … 388 485 } 389 486 487 =head2 list_requests 488 489 List user request currently waiting in base 490 491 =cut 492 390 493 sub list_requests { 391 494 my ($self) = @_; … … 404 507 @ids 405 508 } 509 510 =head2 list_pending_requests 511 512 List user request to apply 513 514 =cut 406 515 407 516 sub list_pending_requests { … … 422 531 @ids 423 532 } 533 534 =head2 list_auto_pending_requests 535 536 List automatic request 537 538 =cut 424 539 425 540 sub list_auto_pending_requests {
Note: See TracChangeset
for help on using the changeset viewer.