MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / list

Method list

src/jrd/UserManagement.cpp:492–578  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

490}
491
492void UserManagement::list(IUser* u, unsigned cachePosition)
493{
494 RecordBuffer* buffer = getData(rel_sec_users);
495 Record* record = buffer->getTempRecord();
496 record->nullify();
497
498 const MetaName& plugName(managers[cachePosition].first);
499 putField(threadDbb, record,
500 DumpField(f_sec_plugin, VALUE_STRING, static_cast<USHORT>(plugName.length()), plugName.c_str()));
501
502 bool su = false;
503
504 if (u->userName()->entered())
505 {
506 const char* uname = u->userName()->get();
507 putField(threadDbb, record,
508 DumpField(f_sec_user_name, VALUE_STRING, static_cast<USHORT>(strlen(uname)), uname));
509 su = strcmp(uname, DBA_USER_NAME) == 0;
510 }
511
512 if (u->firstName()->entered())
513 {
514 putField(threadDbb, record,
515 DumpField(f_sec_first_name, VALUE_STRING, static_cast<USHORT>(strlen(u->firstName()->get())), u->firstName()->get()));
516 }
517
518 if (u->middleName()->entered())
519 {
520 putField(threadDbb, record,
521 DumpField(f_sec_middle_name, VALUE_STRING, static_cast<USHORT>(strlen(u->middleName()->get())), u->middleName()->get()));
522 }
523
524 if (u->lastName()->entered())
525 {
526 putField(threadDbb, record,
527 DumpField(f_sec_last_name, VALUE_STRING, static_cast<USHORT>(strlen(u->lastName()->get())), u->lastName()->get()));
528 }
529
530 if (u->active()->entered())
531 {
532 UCHAR v = u->active()->get() ? '\1' : '\0';
533 putField(threadDbb, record,
534 DumpField(f_sec_active, VALUE_BOOLEAN, sizeof(v), &v));
535 }
536
537 if (su || u->admin()->entered())
538 {
539 UCHAR v = (su || u->admin()->get()) ? '\1' : '\0';
540 putField(threadDbb, record,
541 DumpField(f_sec_admin, VALUE_BOOLEAN, sizeof(v), &v));
542 }
543
544 if (u->comment()->entered())
545 {
546 putField(threadDbb, record,
547 DumpField(f_sec_comment, VALUE_STRING, static_cast<USHORT>(strlen(u->comment()->get())), u->comment()->get()));
548 }
549

Callers 5

extractAssetsMethod · 0.45
executeMethod · 0.45
listMethod · 0.45
callRemoteServiceManagerFunction · 0.45
typeBufferFunction · 0.45

Calls 15

DumpFieldClass · 0.85
getTempRecordMethod · 0.80
nullifyMethod · 0.80
lengthMethod · 0.45
c_strMethod · 0.45
enteredMethod · 0.45
userNameMethod · 0.45
getMethod · 0.45
firstNameMethod · 0.45
middleNameMethod · 0.45
lastNameMethod · 0.45
activeMethod · 0.45

Tested by

no test coverage detected