Exemplo n.º 1
0
    void SetMechanismCommand(const CString& sLine) {
        CString sMechanisms = sLine.Token(1, true).AsUpper();

        if (!sMechanisms.empty()) {
            VCString vsMechanisms;
            sMechanisms.Split(" ", vsMechanisms);

            for (const CString& sMechanism : vsMechanisms) {
                if (!SupportsMechanism(sMechanism)) {
                    PutModule("Unsupported mechanism: " + sMechanism);
                    return;
                }
            }

            SetNV(NV_MECHANISMS, sMechanisms);
        }

        PutModule("Current mechanisms set: " + GetMechanismsString());
    }
Exemplo n.º 2
0
Arquivo: sasl.cpp Projeto: ConorOG/znc
	void SetMechanismCommand(const CString& sLine) {
		CString sMechanisms = sLine.Token(1, true).AsUpper();

		if (!sMechanisms.empty()) {
			VCString vsMechanisms;
			sMechanisms.Split(" ", vsMechanisms);

			for (VCString::const_iterator it = vsMechanisms.begin(); it != vsMechanisms.end(); ++it) {
				if (!SupportsMechanism(*it)) {
					PutModule("Unsupported mechanism: " + *it);
					return;
				}
			}

			SetNV(NV_MECHANISMS, sMechanisms);
		}

		PutModule("Current mechanisms set: " + GetMechanismsString());
	}
Exemplo n.º 3
0
    void SetMechanismCommand(const NoString& line)
    {
        NoString sMechanisms = No::tokens(line, 1).toUpper();

        if (!sMechanisms.empty()) {
            NoStringVector vsMechanisms = sMechanisms.split(" ");

            for (NoStringVector::const_iterator it = vsMechanisms.begin(); it != vsMechanisms.end(); ++it) {
                if (!SupportsMechanism(*it)) {
                    putModule("Unsupported mechanism: " + *it);
                    return;
                }
            }

            NoRegistry registry(this);
            registry.setValue(NV_MECHANISMS, sMechanisms);
        }

        putModule("Current mechanisms set: " + GetMechanismsString());
    }