@@ -482,7 +482,12 @@ bool KBEEmailVerificationTableMysql::queryAccount(DBInterface * dbi, int8 type,
482482 SAFE_RELEASE_ARRAY (tbuf);
483483
484484 if (!dbi->query (sqlstr.c_str (), sqlstr.size (), false ))
485+ {
486+ ERROR_MSG (boost::format (" KBEEmailVerificationTableMysql::queryAccount(%1%): sql(%2%) is failed(%3%)!\n " ) %
487+ name % sqlstr % dbi->getstrerror ());
488+
485489 return false ;
490+ }
486491
487492 info.datas = " " ;
488493 MYSQL_RES * pResult = mysql_store_result (static_cast <DBInterfaceMysql*>(dbi)->mysql ());
@@ -542,7 +547,12 @@ bool KBEEmailVerificationTableMysql::logAccount(DBInterface * dbi, int8 type, co
542547 SAFE_RELEASE_ARRAY (tbuf);
543548
544549 if (!dbi->query (sqlstr.c_str (), sqlstr.size (), false ))
550+ {
551+ ERROR_MSG (boost::format (" KBEEmailVerificationTableMysql::logAccount(%1%): sql(%2%) is failed(%3%)!\n " ) %
552+ code % sqlstr % dbi->getstrerror ());
553+
545554 return false ;
555+ }
546556
547557 return true ;
548558}
@@ -566,7 +576,12 @@ bool KBEEmailVerificationTableMysql::activateAccount(DBInterface * dbi, const st
566576 SAFE_RELEASE_ARRAY (tbuf);
567577
568578 if (!dbi->query (sqlstr.c_str (), sqlstr.size (), false ))
579+ {
580+ ERROR_MSG (boost::format (" KBEEmailVerificationTableMysql::activateAccount(%1%): sql(%2%) is failed(%3%)!\n " ) %
581+ code % sqlstr % dbi->getstrerror ());
582+
569583 return false ;
584+ }
570585
571586 uint64 logtime = 1 ;
572587
@@ -586,10 +601,18 @@ bool KBEEmailVerificationTableMysql::activateAccount(DBInterface * dbi, const st
586601 }
587602
588603 if (logtime > 0 && time (NULL ) - logtime > g_kbeSrvConfig.emailAtivationInfo_ .deadline )
604+ {
605+ ERROR_MSG (boost::format (" KBEEmailVerificationTableMysql::activateAccount(%1%): is expired! %2% > %3%.\n " ) %
606+ code % (time (NULL ) - logtime) % g_kbeSrvConfig.emailAtivationInfo_ .deadline );
607+
589608 return false ;
609+ }
590610
591611 if (info.name .size () == 0 )
592612 {
613+ ERROR_MSG (boost::format (" KBEEmailVerificationTableMysql::activateAccount(%1%): name is NULL.\n " ) %
614+ code);
615+
593616 return false ;
594617 }
595618
@@ -612,16 +635,29 @@ bool KBEEmailVerificationTableMysql::activateAccount(DBInterface * dbi, const st
612635 }
613636
614637 if ((info.flags & ACCOUNT_FLAG_NOT_ACTIVATED ) <= 0 )
638+ {
639+ ERROR_MSG (boost::format (" KBEEmailVerificationTableMysql::activateAccount(%1%): Has been activated.\n " ) %
640+ code);
641+
615642 return false ;
643+ }
616644
617645 info.flags &= ~ACCOUNT_FLAG_NOT_ACTIVATED ;
618646
619647 if (!pTable->setFlagsDeadline (dbi, info.name , info.flags , info.deadline ))
648+ {
649+ ERROR_MSG (boost::format (" KBEEmailVerificationTableMysql::activateAccount(%1%): set deadline is error(%2%)!\n " ) %
650+ code % dbi->getstrerror ());
620651 return false ;
621-
652+ }
622653
623654 if (!pTable->updatePassword (dbi, info.name , password))
655+ {
656+ ERROR_MSG (boost::format (" KBEEmailVerificationTableMysql::activateAccount(%1%): update password is error(%2%)!\n " ) %
657+ code % dbi->getstrerror ());
658+
624659 return false ;
660+ }
625661
626662 if (info.dbid == 0 )
627663 {
@@ -645,6 +681,9 @@ bool KBEEmailVerificationTableMysql::activateAccount(DBInterface * dbi, const st
645681 if (!dbi->query ((boost::format (" update kbe_accountinfos set entityDBID=%1% where accountName like \" %2%\" " )
646682 % info.dbid % tbuf).str (), false ))
647683 {
684+ ERROR_MSG (boost::format (" KBEEmailVerificationTableMysql::activateAccount(%1%): update kbe_accountinfos is error(%2%)!\n " ) %
685+ code % dbi->getstrerror ());
686+
648687 SAFE_RELEASE_ARRAY (tbuf);
649688 return false ;
650689 }
@@ -681,7 +720,12 @@ bool KBEEmailVerificationTableMysql::bindEMail(DBInterface * dbi, const std::str
681720 SAFE_RELEASE_ARRAY (tbuf);
682721
683722 if (!dbi->query (sqlstr.c_str (), sqlstr.size (), false ))
723+ {
724+ ERROR_MSG (boost::format (" KBEEmailVerificationTableMysql::bindEMail(%1%): sql(%2%) is failed(%3%)!\n " ) %
725+ code % sqlstr % dbi->getstrerror ());
726+
684727 return false ;
728+ }
685729
686730 uint64 logtime = 1 ;
687731
@@ -703,10 +747,18 @@ bool KBEEmailVerificationTableMysql::bindEMail(DBInterface * dbi, const std::str
703747 }
704748
705749 if (logtime > 0 && time (NULL ) - logtime > g_kbeSrvConfig.emailBindInfo_ .deadline )
750+ {
751+ ERROR_MSG (boost::format (" KBEEmailVerificationTableMysql::bindEMail(%1%): is expired! %2% > %3%.\n " ) %
752+ code % (time (NULL ) - logtime) % g_kbeSrvConfig.emailBindInfo_ .deadline );
753+
706754 return false ;
755+ }
707756
708757 if (qname.size () == 0 || qemail.size () == 0 )
709758 {
759+ ERROR_MSG (boost::format (" KBEEmailVerificationTableMysql::bindEMail(%1%): name or email is NULL.\n " ) %
760+ code);
761+
710762 return false ;
711763 }
712764
@@ -737,6 +789,9 @@ bool KBEEmailVerificationTableMysql::bindEMail(DBInterface * dbi, const std::str
737789
738790 if (!dbi->query (sqlstr, false ))
739791 {
792+ ERROR_MSG (boost::format (" KBEEmailVerificationTableMysql::bindEMail(%1%): update kbe_accountinfos is error(%2%)!\n " ) %
793+ code % dbi->getstrerror ());
794+
740795 return false ;
741796 }
742797
@@ -771,7 +826,12 @@ bool KBEEmailVerificationTableMysql::resetpassword(DBInterface * dbi, const std:
771826 SAFE_RELEASE_ARRAY (tbuf);
772827
773828 if (!dbi->query (sqlstr.c_str (), sqlstr.size (), false ))
829+ {
830+ ERROR_MSG (boost::format (" KBEEmailVerificationTableMysql::resetpassword(%1%): sql(%2%) is failed(%3%)!\n " ) %
831+ code % sqlstr % dbi->getstrerror ());
832+
774833 return false ;
834+ }
775835
776836 uint64 logtime = 1 ;
777837
@@ -791,10 +851,18 @@ bool KBEEmailVerificationTableMysql::resetpassword(DBInterface * dbi, const std:
791851 }
792852
793853 if (logtime > 0 && time (NULL ) - logtime > g_kbeSrvConfig.emailResetPasswordInfo_ .deadline )
854+ {
855+ ERROR_MSG (boost::format (" KBEEmailVerificationTableMysql::bindEMail(%1%): is expired! %2% > %3%.\n " ) %
856+ code % (time (NULL ) - logtime) % g_kbeSrvConfig.emailResetPasswordInfo_ .deadline );
857+
794858 return false ;
859+ }
795860
796861 if (qname.size () == 0 || password.size () == 0 )
797862 {
863+ ERROR_MSG (boost::format (" KBEEmailVerificationTableMysql::resetpassword(%1%): name or password is NULL.\n " ) %
864+ code);
865+
798866 return false ;
799867 }
800868
@@ -821,7 +889,12 @@ bool KBEEmailVerificationTableMysql::resetpassword(DBInterface * dbi, const std:
821889 }
822890
823891 if (!pTable->updatePassword (dbi, name, md5password))
892+ {
893+ ERROR_MSG (boost::format (" KBEEmailVerificationTableMysql::resetpassword(%1%): update password is error(%2%)!\n " ) %
894+ code % dbi->getstrerror ());
895+
824896 return false ;
897+ }
825898
826899
827900 try
@@ -855,7 +928,12 @@ bool KBEEmailVerificationTableMysql::delAccount(DBInterface * dbi, int8 type, co
855928 SAFE_RELEASE_ARRAY (tbuf);
856929
857930 if (!dbi->query (sqlstr.c_str (), sqlstr.size (), false ))
931+ {
932+ ERROR_MSG (boost::format (" KBEEmailVerificationTableMysql::delAccount(%1%): sql(%2%) is failed(%3%)!\n " ) %
933+ name % sqlstr % dbi->getstrerror ());
934+
858935 return false ;
936+ }
859937
860938 return true ;
861939}
0 commit comments