From: <hp...@us...> - 2003-02-15 11:59:40
|
Update of /cvsroot/tora/tora In directory sc8-pr-cvs1:/tmp/cvs-serv28737 Modified Files: NEWS otlv4.h toconnection.h tonewconnection.cpp tooracleconnection.cpp tooracleextract.cpp Log Message: Index: NEWS =================================================================== RCS file: /cvsroot/tora/tora/NEWS,v retrieving revision 1.824 retrieving revision 1.825 diff -C2 -d -r1.824 -r1.825 *** NEWS 13 Feb 2003 14:42:27 -0000 1.824 --- NEWS 15 Feb 2003 11:59:36 -0000 1.825 *************** *** 1,4 **** --- 1,7 ---- 1.3.10: + 2003-02-14: Change password when it has expired. + 2003-02-14: Get password from new connection instead of the password editor in new connections. + 2003-02-14: Fixed problem with getting sizing in oracle extractor. 2003-02-13: Fixed problem with connectionhistory. 2003-02-13: Format BLOB:s as hex when reading. Index: otlv4.h =================================================================== RCS file: /cvsroot/tora/tora/otlv4.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** otlv4.h 7 Oct 2002 18:58:22 -0000 1.8 --- otlv4.h 15 Feb 2003 11:59:36 -0000 1.9 *************** *** 6804,6807 **** --- 6804,6829 ---- } + int change_password + (const char* userid, + const char* password, + const char* newpass) + {int status; + + if(!attached)return 0; + + status=OCIPasswordChange + (svchp, + errhp, + OTL_RCAST(text*,OTL_CCAST(char*,userid)), + strlen(userid), + OTL_RCAST(text*,OTL_CCAST(char*,password)), + strlen(password), + OTL_RCAST(text*,OTL_CCAST(char*,newpass)), + strlen(newpass), + OTL_SCAST(ub4,OCI_DEFAULT)); + if(status)return 0; + return 1; + } + int cancel(void) {int status; *************** *** 8556,8559 **** --- 8578,8600 ---- ++throw_count; if(throw_count>1)return; + #if defined(OTL_STL) && defined(OTL_UNCAUGHT_EXCEPTION_ON) + if(STD_NAMESPACE_PREFIX uncaught_exception())return; + #endif + throw otl_exception(connect_struct); + } + } + + void change_password + (const char* userid, + const char* password, + const char* newpass) + { + retcode=connect_struct.change_password + (userid,password,newpass); + if(!retcode) { + #if 0 + ++throw_count; + if(throw_count>1)return; + #endif #if defined(OTL_STL) && defined(OTL_UNCAUGHT_EXCEPTION_ON) if(STD_NAMESPACE_PREFIX uncaught_exception())return; Index: toconnection.h =================================================================== RCS file: /cvsroot/tora/tora/toconnection.h,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** toconnection.h 4 Feb 2003 21:23:55 -0000 1.53 --- toconnection.h 15 Feb 2003 11:59:36 -0000 1.54 *************** *** 621,624 **** --- 621,628 ---- const QString &password() const { return Password; } + /** Change password of connection. + */ + void setPassword(const QString &pwd) + { Password=pwd; } /** Get host of connection. */ Index: tonewconnection.cpp =================================================================== RCS file: /cvsroot/tora/tora/tonewconnection.cpp,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** tonewconnection.cpp 13 Feb 2003 14:42:30 -0000 1.42 --- tonewconnection.cpp 15 Feb 2003 11:59:36 -0000 1.43 *************** *** 215,224 **** toTool::globalSetConfig(CONF_USER,Username->text()); QString pass; - if (toTool::globalConfig(CONF_SAVE_PWD,DEFAULT_SAVE_PWD)!=DEFAULT_SAVE_PWD) - pass=Password->text(); - else - pass=DEFAULT_SAVE_PWD; - toTool::globalSetConfig(CONF_PASSWORD,toObfuscate(pass)); - toTool::globalSetConfig(CONF_DATABASE,Database->currentText()); QString host; if (SqlNet->isHidden()) --- 215,218 ---- *************** *** 258,261 **** --- 252,264 ---- } } + + if (toTool::globalConfig(CONF_SAVE_PWD,DEFAULT_SAVE_PWD)!=DEFAULT_SAVE_PWD) + pass=retCon->password(); + else + pass=DEFAULT_SAVE_PWD; + toTool::globalSetConfig(CONF_PASSWORD,toObfuscate(pass)); + toTool::globalSetConfig(CONF_DATABASE,Database->currentText()); + toTool::globalSetConfig(CONF_PASSWORD,toObfuscate(retCon->password())); + new QListViewItem(Previous,NULL, Provider->currentText(), *************** *** 263,267 **** Database->currentText(), Username->text(), ! pass); historySave(); return retCon; --- 266,270 ---- Database->currentText(), Username->text(), ! retCon->password()); historySave(); return retCon; Index: tooracleconnection.cpp =================================================================== RCS file: /cvsroot/tora/tora/tooracleconnection.cpp,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** tooracleconnection.cpp 13 Feb 2003 14:42:30 -0000 1.70 --- tooracleconnection.cpp 15 Feb 2003 11:59:36 -0000 1.71 *************** *** 54,57 **** --- 54,58 ---- #include <qcheckbox.h> #include <qfile.h> + #include <qinputdialog.h> #include <qlineedit.h> #include <qpushbutton.h> *************** *** 916,929 **** else if (mode==QString::fromLatin1("SYS_DBA")) session_mode=OCI_SYSDBA; ! conn=new otl_connect; ! conn->set_stream_pool_size(max(toTool::globalConfig(CONF_OPEN_CURSORS, ! DEFAULT_OPEN_CURSORS).toInt(),1)); ! if(!sqlNet) ! conn->server_attach(); ! else ! conn->server_attach(connection().database().utf8()); ! QCString user=connection().user().utf8(); ! QCString pass=connection().password().utf8(); ! conn->session_begin(user.isEmpty()?"":(const char *)user,pass.isEmpty()?"":(const char *)pass,0,session_mode); } catch (const otl_exception &exc) { if (!sqlNet) { --- 917,967 ---- else if (mode==QString::fromLatin1("SYS_DBA")) session_mode=OCI_SYSDBA; ! do { ! conn=new otl_connect; ! conn->set_stream_pool_size(max(toTool::globalConfig(CONF_OPEN_CURSORS, ! DEFAULT_OPEN_CURSORS).toInt(),1)); ! if(!sqlNet) ! conn->server_attach(); ! else ! conn->server_attach(connection().database().utf8()); ! QCString user=connection().user().utf8(); ! QCString pass=connection().password().utf8(); ! try { ! conn->session_begin(user.isEmpty()?"":(const char *)user,pass.isEmpty()?"":(const char *)pass,0,session_mode); ! } catch(const otl_exception &exc) { ! if (toThread::mainThread()&&exc.code==28001) { ! bool ok=false; ! QString newpass=QInputDialog::getText(qApp->translate("toOracleConnection","Password expired"), ! qApp->translate("toOracleConnection","Enter new password"), ! QLineEdit::Password, ! QString::null, ! &ok, ! toMainWidget()); ! if (ok) { ! QString newpass2=QInputDialog::getText(qApp->translate("toOracleConnection","Password expired"), ! qApp->translate("toOracleConnection","Enter password again for confirmation"), ! QLineEdit::Password, ! QString::null, ! &ok, ! toMainWidget()); ! if (ok) { ! if (newpass2!=newpass) ! throw qApp->translate("toOracleConnection","The two passwords doesn't match"); ! QCString nputf=newpass.utf8(); ! conn->change_password(user.isEmpty()?"":(const char *)user, ! pass.isEmpty()?"":(const char *)pass, ! newpass.isEmpty()?"":(const char *)nputf); ! connection().setPassword(newpass); ! delete conn; ! conn=NULL; ! } else ! throw exc; ! } else { ! throw exc; ! } ! } else ! throw exc; ! } ! } while(!conn); } catch (const otl_exception &exc) { if (!sqlNet) { Index: tooracleextract.cpp =================================================================== RCS file: /cvsroot/tora/tora/tooracleextract.cpp,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** tooracleextract.cpp 12 Feb 2003 20:17:47 -0000 1.35 --- tooracleextract.cpp 15 Feb 2003 11:59:36 -0000 1.36 *************** *** 7423,7429 **** static toSQL SQLSetSizing("toOracleExtract:SetSizing", ! "SELECT db_block_size FROM v$parameter WHERE name = 'db_block_size'", "Get information about block sizes from alloced space, same columns"); void toOracleExtract::initialize(toExtract &ext) const { --- 7423,7445 ---- static toSQL SQLSetSizing("toOracleExtract:SetSizing", ! "SELECT value FROM v$parameter WHERE name = 'db_block_size'", "Get information about block sizes from alloced space, same columns"); + static toSQL SQLSetSizingFallback("toOracleExtract:SetSizingFallback", + "SELECT bytes/blocks/1024 AS block_size\n" + " FROM user_free_space\n" + " WHERE bytes IS NOT NULL\n" + " AND blocks IS NOT NULL\n" + " AND ROWNUM < 2", + "Get information about block sizes, same columns"); + + static toSQL SQLSetSizingFallback2("toOracleExtract:SetSizingFallback2", + "SELECT bytes/blocks/1024 AS block_size\n" + " FROM user_segments\n" + " WHERE bytes IS NOT NULL\n" + " AND blocks IS NOT NULL\n" + " AND ROWNUM < 2", + "Get information about block sizes, same columns"); + void toOracleExtract::initialize(toExtract &ext) const { *************** *** 7438,7443 **** ext.setState("Segments",DbaSegments); ! toQList ret=toQuery::readQueryNull(CONNECTION,SQLSetSizing); ! ext.setBlockSize(toShift(ret).toInt()); } --- 7454,7466 ---- ext.setState("Segments",DbaSegments); ! try { ! toQList ret=toQuery::readQueryNull(CONNECTION,SQLSetSizing); ! ext.setBlockSize(toShift(ret).toInt()); ! } catch(...) { ! toQList ret=toQuery::readQueryNull(CONNECTION,SQLSetSizingFallback); ! if (ret.size()==0) ! ret=toQuery::readQueryNull(CONNECTION,SQLSetSizingFallback2); ! ext.setBlockSize(toShift(ret).toInt()); ! } } |