Exemplo n.º 1
0
bool FullName::isEqual(const FullName& right) const
{
    if ( strcmp(getFirstName(),right.getFirstName()) == 0 )
        return true;
    else if (right.getMiddleInitial() == this->mI)
        return true;
    else if ( strcmp(getFirstName(),right.getFirstName()) == 0 )
        return true;
	else
        return false;
}
Exemplo n.º 2
0
bool FullName::isSmaller(const FullName & right) const   // is invoking instance smaller than parameter
{
	if ( strcmp(getFirstName(),right.getFirstName()) < 0 )
        return true;
    else if (right.getMiddleInitial() < this->mI)
        return true;
    else if ( strcmp(getFirstName(),right.getFirstName()) < 0 )
        return true;
	else
        return false;
}
Exemplo n.º 3
0
string Member::toFile()
{
    stringstream output;
    output << "\"" << getLastName() << "\",\"" << getFirstName() << "\",\"" << getEmail() << "\",\"" << getUsername() << "\",\"" << getPassword() << "\"," << creationTime.toFile();
    
    return output.str();
}
Exemplo n.º 4
0
    virtual void copyTo(ISecUser& destination)
    {
        destination.setAuthenticateStatus(getAuthenticateStatus());
        destination.setName(getName());
        destination.setFullName(getFullName());
        destination.setFirstName(getFirstName());
        destination.setLastName(getLastName());
        destination.setEmployeeID(getEmployeeID());
        destination.setRealm(getRealm());
        destination.setFqdn(getFqdn());
        destination.setPeer(getPeer());
        destination.credentials().setPassword(credentials().getPassword());
        destination.credentials().setSessionToken(credentials().getSessionToken());
        destination.credentials().setSignature(credentials().getSignature());
        CDateTime exp;
        credentials().getPasswordExpiration(exp);
        destination.credentials().setPasswordExpiration(exp);
        CDateTime tmpTime;
        destination.setPasswordExpiration(getPasswordExpiration(tmpTime));
        destination.setStatus(getStatus());
        CriticalBlock b(crit);
        Owned<IPropertyIterator> Itr = m_parameters->getIterator();
        ForEach(*Itr)
        {
            destination.setProperty(Itr->getPropKey(),m_parameters->queryProp(Itr->getPropKey()));
        }


//      DBGLOG("Copied name %s to %s",getName(),destination.getName());
    }
Exemplo n.º 5
0
    virtual void copyTo(ISecUser& destination)
    {
        destination.setAuthenticateStatus(getAuthenticateStatus());
        destination.setName(getName());
        destination.setFullName(getFullName());
        destination.setFirstName(getFirstName());
        destination.setLastName(getLastName());
        destination.setRealm(getRealm());
        destination.setFqdn(getFqdn());
        destination.setPeer(getPeer());
        destination.credentials().setPassword(credentials().getPassword());
        CDateTime tmpTime;
        destination.setPasswordExpiration(getPasswordExpiration(tmpTime));
        destination.setStatus(getStatus());
        if(m_parameters.get()==NULL)
            return;
        CriticalBlock b(crit);
        Owned<IPropertyIterator> Itr = m_parameters->getIterator();
        Itr->first();
        while(Itr->isValid())
        {
            destination.setProperty(Itr->getPropKey(),m_parameters->queryProp(Itr->getPropKey()));
            Itr->next();
        }


        //addToken is not currently implemented....
//      DBGLOG("Copied name %s to %s",getName(),destination.getName());
    }
Exemplo n.º 6
0
 void Employee::display() const
 {
     std::cout << "Employee: " << getLastName() << ", " << getFirstName()
         << "\n--------------------------------\n"
         << (mHired ? "Current Employee" : "Former Employee")
         << "\nEmployee Number: " << getEmployeeNumber()
         << "\nSalary: $" << getSalary() << "\n\n";
 }
Exemplo n.º 7
0
 void Employee::display() const
 {
   cout << "Employee: " << getLastName() << ", " << getFirstName() << endl;
   cout << "-------------------------" << endl;
   cout << (bHired ? "Current Employee" : "Former Employee") << endl;
   cout << "Employee Number: " << getEmployeeNumber() << endl;
   cout << "Salary: $" << getSalary() << endl;
   cout << endl;
 }
Exemplo n.º 8
0
bool FullName::operator==( const FullName & right) const
{
    int lastResult = strcmp(getLastName(),right.getLastName());
	if ( lastResult != 0 ) return false;
	int firstResult = strcmp(getFirstName(),right.getFirstName());
	if ( firstResult != 0 ) return false;
	return getMiddleInitial() == right.getMiddleInitial();
	return false;
}
Exemplo n.º 9
0
bool FullName::isSmaller(const FullName & right) const   // is invoking instance smaller than parameter
{
	int lastResult = strcmp(getLastName(),right.getLastName());
	if ( lastResult < 0 ) return true;
	if ( lastResult > 0 ) return false;
	int firstResult = strcmp(getFirstName(),right.getFirstName());
	if ( firstResult < 0 ) return true;
	if ( firstResult > 0 ) return false;
	return getMiddleInitial() < right.getMiddleInitial();
	return false;
}
Exemplo n.º 10
0
ContactvCard::ConvertStatus ContactvCard::convert(Contact* contact)
{ 
  contact->first_name       = getFirstName().toStdString();
  contact->last_name        = getLastName().toStdString();
  contact->dac_id_string    = getKHID().toStdString();
  contact->notes            = getNotes().toStdString();
  contact->privacy_setting  = bts::addressbook::secret_contact;
  contact->setIcon(QIcon(":/images/user.png"));
  if (public_key_address::convert(getPublicKey().toStdString(), &contact->public_key) == false)
    return ConvertStatus::PUBLIC_KEY_INVALID;

  return ConvertStatus::SUCCESS;
}
Exemplo n.º 11
0
int readFirstNames(char *firstnames[])
{
	int i;
	char *name;
	i = 0;
	FILE *fp;
	fp = fopen("names.txt", "r");
	while ((name = getFirstName(fp)) != NULL) {
		firstnames[i++] = name;
	}
	firstnames[i] = NULL;
	fclose(fp);
	return i;
}
Exemplo n.º 12
0
void CLdapSecUser::copyTo(ISecUser& destination)
{
    CLdapSecUser* dest = dynamic_cast<CLdapSecUser*>(&destination);
    if(!dest)
        return;

    dest->setAuthenticated(isAuthenticated());
    dest->setName(getName());
    dest->setFullName(getFullName());
    dest->setFirstName(getFirstName());
    dest->setLastName(getLastName());
    dest->setRealm(getRealm());
    dest->credentials().setPassword(credentials().getPassword());
    dest->setUserSid(m_usersid.length(), m_usersid.toByteArray());
    dest->setUserID(m_userid);
    dest->setPasswordExpiration(m_passwordExpiration);
}
Exemplo n.º 13
0
void AddressBookContact::keywordMatching(const QString& keywordLowercase)
{
	QString fn = getFirstName().toLower();
	QString ln = getLastName().toLower();
	QString latin = getLatinFullName().toLower();
	int indexInFirstname = fn.indexOf( keywordLowercase );
	int indexInLastname = ln.indexOf( keywordLowercase );
	int indexInLatinName = latin.indexOf( keywordLowercase );
	qDebug() << "keywordMatching():fn=" << fn
			 << ",ln=" << ln
			 << ",latin=" << latin;
	qDebug() << "keywordMatching():indexInFirstname=" << indexInFirstname
			 << ":indexInLastname=" << indexInLastname
			 << ":indexInLatinName=" << indexInLatinName;
	if ( indexInFirstname >= 0 || indexInLastname >= 0 || indexInLatinName >= 0 )
	{
		setIsKeywordMatched(true);
	}
	else
	{
		setIsKeywordMatched(false);
	}
}
Exemplo n.º 14
0
void CLdapSecUser::copyTo(ISecUser& destination)
{
    if (this == &destination)
        return;

    CLdapSecUser* dest = dynamic_cast<CLdapSecUser*>(&destination);
    if(!dest)
        return;

    dest->setAuthenticateStatus(getAuthenticateStatus());
    dest->setName(getName());
    dest->setFullName(getFullName());
    dest->setFirstName(getFirstName());
    dest->setLastName(getLastName());
    dest->setEmployeeID(getEmployeeID());
    dest->setRealm(getRealm());
    dest->credentials().setPassword(credentials().getPassword());
    dest->setUserSid(m_usersid.length(), m_usersid.toByteArray());
    dest->setUserID(m_userid);
    dest->setPasswordExpiration(m_passwordExpiration);
    dest->setDistinguishedName(m_distinguishedName);
    dest->credentials().setSessionToken(&m_sessionToken);
    dest->credentials().setSignature(&m_signature);
}
Exemplo n.º 15
0
const std::string LLSavedLoginEntry::getDisplayString() const
{
	std::ostringstream etitle;
	etitle << getFirstName() << " " << getLastName() << " (" <<	getGridName() << ")";
	return etitle.str();
}
Exemplo n.º 16
0
void FullName::print(ostream & out ) const  // of the form:    Doe, John A.
{
	out << getLastName() << ',' << getFirstName() << ' ' << getMiddleInitial() << '.';
}
// print Employee's information (virtual, but not pure virtual)
void Employee::print() const
{
	cout << getFirstName() << " " << getLastName()
		<< "\nsocial security number: " << getSocialSecurityNumber()
		<< "\nbirthday: " << getBirthDate();
}