本文整理汇总了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"));
}
}
示例2: close
void All::on_pushButton_2_clicked()
{
close();
Admin ad;
ad.setModal(true);
ad.exec();
}
示例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();
}
示例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;
}
示例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();
}
}
示例6: close
void Deluser::on_pushButton_back_deluser_clicked()
{
close();
Admin admback;
admback.setModal(true);
admback.exec();
}
示例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;
}
}
示例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;
}
示例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;
}
示例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;
}
示例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");
}
示例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());
}
示例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;
}
示例14: getProjectList
AdminMainControl::AdminMainControl(Admin &admin) :
_admin(admin), _view(*this)
{
getProjectList();
_view.setName(admin.getDisplayName());
_view.setModal(true);
_view.exec();
}
示例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);
}