当前位置: 首页>>代码示例>>C++>>正文


C++ Admin类代码示例

本文整理汇总了C++中Admin的典型用法代码示例。如果您正苦于以下问题:C++ Admin类的具体用法?C++ Admin怎么用?C++ Admin使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Admin类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: httpRequest

void SessionController::login()
{
    if (httpRequest().method() != Tf::Post) {
        return;
    }

    QString password_md5;
    QByteArray bb;
    QString username = httpRequest().formItemValue("username");
    QString password = httpRequest().formItemValue("password");

    bb = QCryptographicHash::hash ( password.toLocal8Bit(), QCryptographicHash::Md5 );
    password_md5.append(bb.toHex());

    Admin admin = Admin::authenticate(username, password_md5);

    if(!admin.isNull()) {
        userLogin(&admin);
        redirect(QUrl("/admin/dashboard"));
    } else {
        QString message = "Login failed";
        texport(message);
        redirect(url("session", "form"));
    }
}
开发者ID:czjin,项目名称:bbpark,代码行数:25,代码来源:sessioncontroller.cpp

示例2: close

void All::on_pushButton_2_clicked()
{
    close();
    Admin ad;
    ad.setModal(true);
    ad.exec();
}
开发者ID:antonmazun,项目名称:gogog,代码行数:7,代码来源:all.cpp

示例3: QString

void MainWindow::on_pushButton_clicked()
{
	QSqlQuery q;
	q.exec("SELECT user.id, usertype.typeuser FROM user, usertype\
			WHERE usertype.id = user.type_user AND user.id = '"\
			+ ui->user->currentData().toString() + "' AND user.pass = '"\
			+ QString(QCryptographicHash::hash(\
				ui->passEdit->text().toUtf8(),\
				QCryptographicHash::Md5).toHex())+"'");

	q.next();
	int userID = q.value("id").toInt();
	QString typeUser = q.value(1).toString();
	qDebug()<<userID<<" "<<typeUser;
	qDebug()<<q.lastError();

	/*db.close();
	db = QSqlDatabase::addDatabase("QMYSQL");
	db.setHostName("127.0.0.1");
	db.setPort(3306);
	db.setDatabaseName("gkhdb");*/

	this->hide();	
	if(typeUser == "администратор")
	{
		/*db.setUserName("root");
		db.setPassword("qwer");
		db.open();*/
		Admin* a = new Admin;
		a->showMaximized();
		connect(this,SIGNAL(sendUser(int)),a,SLOT(recieveUserID(int)));
		emit sendUser(userID);
		a->exec();
		a->deleteLater();
	}
开发者ID:drewdru,项目名称:RKP_kurs_work,代码行数:35,代码来源:mainwindow.cpp

示例4: subzone

 usword_t SubzoneBlockRef::dec_refcount_no_lock() const {
     Admin *admin = subzone()->admin();
     if (has_refcount()) {
         // non-zero reference count, check the overflow table.
         PtrIntHashMap &retains = admin->retains();
         PtrIntHashMap::iterator retain_iter = retains.find(address());
         if (retain_iter != retains.end() && retain_iter->first == address()) {
             if (--retain_iter->second == 1) {
                 // transition from 2 -> 1
                 retains.erase(retain_iter);
                 return 1;
             } else {
                 return retain_iter->second;
             }
         } else {
             // transition from 1 -> 0
             subzone()->clear_has_refcount(q());
             return 0;
         }
     }
     // underflow.
     malloc_printf("reference count underflow for %p, break on auto_refcount_underflow_error to debug.\n", address());
     auto_refcount_underflow_error(address());
     return -1;
 }
开发者ID:unofficial-opensource-apple,项目名称:libauto,代码行数:25,代码来源:BlockRef.cpp

示例5: process

void Game::process()
{
   Admin* admin;
   Client * player;
   Clients* clients = mClientMgr.list();
   bool worldSave = false;
   for (Clients::iterator client=clients->begin(); client != clients->end(); client++)
   {
      player = client->second;
      if (player->isAdmin())
      {
         admin = player->getAdmin();

         /* Add any buildings that an admin has placed down. */
         processBuildingReqs(admin);

         /* Check if the save command was issued */
         if (admin->getWorldSaveReq())
         {
            worldSave = true;
         }
      }
   }

   if (worldSave)
   {
      mZoneMgr.saveWorld();
   }
}
开发者ID:9981juhehua,项目名称:Hardwar,代码行数:29,代码来源:Game.cpp

示例6: close

void Deluser::on_pushButton_back_deluser_clicked()
{
    close();
    Admin admback;
    admback.setModal(true);
    admback.exec();


}
开发者ID:antonmazun,项目名称:gogog,代码行数:9,代码来源:deluser.cpp

示例7: updateAdmin

/**
 * return 108;//管理员更新成功
 * return 109;//管理员更新失败
 */
int AdminService::updateAdmin(Admin admin){

	string sql = "update admin set a_name='"+ admin.getName() + "',a_psd='" + admin.getPsd() + "',a_priority='"+ admin.getPriority() +"' where u_id='"+admin.getId()+"'";
cout<<"AdminService::updateAdmin ---- update sql="<<sql<<endl;
	DBConn db;
	if(db.Execute_mysql(sql)==0){
		db.Close_mysql();
		return 108;
	}else{

		db.Close_mysql();
		return 109;
	}
}
开发者ID:xjtuse2014,项目名称:IPMP_10.8,代码行数:18,代码来源:AdminService.cpp

示例8: _tmain

int _tmain(int argc, _TCHAR* argv[])
{

    //Car mazda; // создание экземпл¤ра класса или объекта
    //mazda.name = "Mazda";
    //mazda.color = "Red";
    //mazda.set_model("RX7");
    //mazda.show();

    Admin admin;
    //admin.init();
    admin.PleesGetMyInternet("user", "1234");
    return 0;
}
开发者ID:maxchv,项目名称:IntruductionSummer2015,代码行数:14,代码来源:Classes.cpp

示例9: Admin

void Admintest::test_LogoutOperation_other_but_unconnected()
{
    Account_LogoutOperation_called = 0;
    m_account->m_connection = 0;

    long cid = m_id_counter++;
    std::string cid_str = String::compose("%1", cid);
    Account * ac2 = new Admin(0,
                              "f3332c00-5d2b-45c1-8cf4-3429bdf2845f",
                              "c0e095f0-575c-477c-bafd-2055d6958d4d",
                              cid_str, cid);

    m_server->addObject(ac2);

    ASSERT_EQUAL(m_server->getObject(cid_str), ac2);

    Atlas::Objects::Operation::Logout op;
    OpVector res;

    Anonymous arg;
    arg->setId(cid_str);
    op->setArgs1(arg);

    m_account->LogoutOperation(op, res);

    ASSERT_EQUAL(res.size(), 1u);
    ASSERT_EQUAL(res.front()->getClassNo(),
                 Atlas::Objects::Operation::ERROR_NO);

    ASSERT_NULL(Account_LogoutOperation_called);

    delete ac2;
}
开发者ID:cyclefusion,项目名称:cyphesis,代码行数:33,代码来源:Admintest.cpp

示例10: test_GetOperation_obj_IG

void Admintest::test_GetOperation_obj_IG()
{
    long cid = m_id_counter++;
    std::string cid_str = String::compose("%1", cid);
    Entity * to = new Entity(cid_str, cid);

    m_server->m_world.addEntity(to);

    Atlas::Objects::Operation::Get op;
    OpVector res;

    Anonymous arg;
    arg->setObjtype("obj");
    arg->setId(cid_str);
    op->setArgs1(arg);

    m_account->GetOperation(op, res);

    ASSERT_EQUAL(res.size(), 1u);

    const Operation & reply = res.front();

    ASSERT_EQUAL(reply->getClassNo(),
                 Atlas::Objects::Operation::INFO_NO);
    ASSERT_EQUAL(reply->getArgs().size(), 1u);

    const Root & reply_arg = reply->getArgs().front();

    ASSERT_TRUE(!reply_arg->isDefaultId());
    ASSERT_EQUAL(reply_arg->getId(), to->getId());

    delete to;
}
开发者ID:cyclefusion,项目名称:cyphesis,代码行数:33,代码来源:Admintest.cpp

示例11: test_GetOperation_rule_found

void Admintest::test_GetOperation_rule_found()
{
    Atlas::Objects::Operation::Get op;
    OpVector res;

    Anonymous arg;
    arg->setObjtype("class");
    arg->setId("root");
    op->setArgs1(arg);

    m_account->GetOperation(op, res);

    ASSERT_EQUAL(res.size(), 1u);

    const Operation & reply = res.front();

    ASSERT_EQUAL(reply->getClassNo(),
                 Atlas::Objects::Operation::INFO_NO);
    ASSERT_EQUAL(reply->getArgs().size(), 1u);

    const Root & reply_arg = reply->getArgs().front();

    ASSERT_TRUE(!reply_arg->isDefaultId());
    ASSERT_EQUAL(reply_arg->getId(), "root");
}
开发者ID:cyclefusion,项目名称:cyphesis,代码行数:25,代码来源:Admintest.cpp

示例12: assert

void Admintest::test_customMonitorOperation_monitorin()
{
    // Check that Dispatching in not yet connected
    assert(m_server->m_world.Dispatching.slots().begin() ==
                 m_server->m_world.Dispatching.slots().end());

    // Set it up so it is already monitoring
    m_account->m_monitorConnection =
          null_signal.connect(sigc::mem_fun(this, &Admintest::null_method));
    ASSERT_TRUE(m_account->m_monitorConnection.connected());

    Atlas::Objects::Operation::Monitor op;
    OpVector res;

    Root arg;
    op->setArgs1(arg);

    m_account->customMonitorOperation(op, res);

    ASSERT_TRUE(m_account->m_monitorConnection.connected());

    // Check that Dispatching in not been connected
    assert(m_server->m_world.Dispatching.slots().begin() ==
                 m_server->m_world.Dispatching.slots().end());

}
开发者ID:cyclefusion,项目名称:cyphesis,代码行数:26,代码来源:Admintest.cpp

示例13: test_SetOperation_obj_IG

void Admintest::test_SetOperation_obj_IG()
{
    Account_SetOperation_called = 0;

    long cid = m_id_counter++;
    Entity * c = new Entity(compose("%1", cid), cid);

    m_account->m_charactersDict.insert(std::make_pair(cid, c));

    Atlas::Objects::Operation::Set op;
    OpVector res;

    Anonymous arg;
    arg->setObjtype("obj");
    arg->setId(c->getId());
    op->setArgs1(arg);

    m_account->SetOperation(op, res);

    ASSERT_EQUAL(Account_SetOperation_called, m_account);

    // The operation returned would have come from Account::SetOperation
    // but that is stubbed out
    ASSERT_EQUAL(res.size(), 0u);

    delete c;
}
开发者ID:cyclefusion,项目名称:cyphesis,代码行数:27,代码来源:Admintest.cpp

示例14: getProjectList

AdminMainControl::AdminMainControl(Admin &admin) :
    _admin(admin), _view(*this)
{
    getProjectList();
    _view.setName(admin.getDisplayName());
    _view.setModal(true);
    _view.exec();
}
开发者ID:GuelorEmanuel,项目名称:Team-Tech-Support,代码行数:8,代码来源:adminmaincontrol.cpp

示例15: test_LogoutOperation_self

void Admintest::test_LogoutOperation_self()
{
    Account_LogoutOperation_called = 0;

    Operation op;
    OpVector res;

    Anonymous arg;
    arg->setId(m_account->getId());
    op->setArgs1(arg);

    m_account->LogoutOperation(op, res);

    ASSERT_EQUAL(res.size(), 0u);

    ASSERT_EQUAL(Account_LogoutOperation_called, m_account);
}
开发者ID:cyclefusion,项目名称:cyphesis,代码行数:17,代码来源:Admintest.cpp


注:本文中的Admin类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。