Exemplo n.º 1
0
 bool Loop()
 {
    size_t row = 0;
    if (!(IsBOF() && IsEOF())) for (MoveFirst(); !IsEOF(); MoveNext(), row++)
    {
       //TRACE(_T("row %3d\n"), row);
       NewRecord();
       for (int i = 0; i < GetFieldCount(); i++)
       {
          COleVariant var;
    	   GetFieldValue(i, var);
          SaveField(i, var);
       }
       SaveRecord();
    }
    return true;
 }
Exemplo n.º 2
0
void User::SaveHomeDir()
{
  SaveField("home dir");
}
Exemplo n.º 3
0
void User::SaveWeeklyAllotment()
{
  SaveField("weekly allotment");
}
Exemplo n.º 4
0
void User::SaveGadminGIDs()
{
  SaveField("gadmin gids");
}
Exemplo n.º 5
0
void User::SaveFlags()
{
  SaveField("flags");
}
Exemplo n.º 6
0
void User::SaveIPMasks()
{
  SaveField("ip masks");
}
Exemplo n.º 7
0
//______________________________________________________________________________
//                                                                            []
//` BX_Admin_SaveBXObjects                                                    []                      
//                                                                            []
BX_RESULT 
BX_Admin_SaveBXObjects(BX_Admin_Args& arg)
{
	OC_VBN			oc_vbn;
	OC_User			oc_user;
	OC_Site			oc_site;
	key_arr			ka;

	BX_User_Args	user_args;
	BX_Site_Args	site_args;

	string			sFile;
	string			sTemp;

	if (!CheckAdminPassword(arg.Password))
		return BXE_BadAdminPassword;

//----------------------------------------------------------------------------[]
// Сохранение пользователей:
	for (oc_user.GoFirst(); oc_user.IsValid(); oc_user.GoNext())
	{
		sFile += OBJECT_DELIMITER;

	// Найти VBN юзера с целью узнать её ID:
		ka.Init();
		ka += (byte)oc_user.m_VBN;
		oc_vbn.SetIndex_No();
		SERVER_DEBUG_ASSERT_RETURN(oc_vbn.Find(ka), "BX_Admin_SaveBXObjects(): Invalid User::VBN.", BX_SYSTEM_ERROR);

	// Получить данные о пользователе:
		user_args.objID		= oc_user.GetObjectID();
		user_args.Login		= oc_user.m_Login;
		user_args.Password	= oc_user.m_Password;
		user_args.VBN			= oc_vbn.GetObjectID();
		BX_ASSERT_RETURN(BX_User_GetData(user_args));

	// Сохранить данные, необходимые для BX_User_New:
		sTemp.Format("User_New:%lu\n", oc_user.GetObjectID());					sFile += sTemp;
																									
		SaveField(sTemp,  user_args.Login,		"Login");							sFile += sTemp;
		SaveField(sTemp,  user_args.Password,	"Password");						sFile += sTemp;
		SaveField(sTemp,  user_args.Password,	"PasswordConfirm");				sFile += sTemp;
		SaveField(sTemp,  user_args.FullName,	"FullName");						sFile += sTemp;
		SaveField(sTemp,  user_args.Email,		"Email");							sFile += sTemp;

	//- - - - - - - - - - - - - - - - - - - - - - - - - - -]
		sFile += FUNCTION_DELIMITER;
	//- - - - - - - - - - - - - - - - - - - - - - - - - - -]
	// Сохранить данные, необходимые для BX_User_PutData:
		sTemp.Format("User_PutData:%lu\n", oc_user.GetObjectID());				sFile += sTemp;

		SaveField(sTemp,  user_args.Password,				"Password");			sFile += sTemp;
		SaveField(sTemp,  user_args.FullName,				"FullName");			sFile += sTemp;
		SaveField(sTemp,  user_args.InterfaceLanguage,	"InterfaceLanguage");sFile += sTemp;
		SaveField(sTemp,  user_args.InterfaceType,		"InterfaceType");		sFile += sTemp;
		SaveField(sTemp,  user_args.Email,					"Email");				sFile += sTemp;
		SaveField(sTemp,  user_args.Phone,					"Phone");				sFile += sTemp;
		SaveField(sTemp,  user_args.Fax,						"Fax");					sFile += sTemp;
		SaveField(sTemp,  user_args.Address,				"Address");				sFile += sTemp;
		SaveField(sTemp,  user_args.URL,						"URL");					sFile += sTemp;
		SaveField(sTemp,  user_args.Comment,				"Comment");				sFile += sTemp;
		SaveField(sTemp,  user_args.TZOffset,				"TZOffset");			sFile += sTemp;
		SaveField(sTemp,  user_args.NotifyFreq,			"NotifyFreq");			sFile += sTemp;
		SaveField(sTemp,  user_args.NotifyHTML,			"NotifyHTML");			sFile += sTemp;
		SaveField(sTemp,  user_args.NotifyDepth,			"NotifyDepth");		sFile += sTemp;
	}

//----------------------------------------------------------------------------[]
// Сохранение сайтов:
	for (oc_site.GoFirst(); oc_site.IsValid(); oc_site.GoNext())
	{
		sFile += OBJECT_DELIMITER;

	// Открыть владельца сайта с целью узнать его пароль:
		BX_CHECK_AND_OPEN(oc_user, oc_site.m_OwnerID, OBJ_CLASS_ID_User);

	// Получить данные о сайте:
		site_args.objID		= oc_site.GetObjectID();
		site_args.objPassword= oc_user.m_Password;
		BX_ASSERT_RETURN(BX_Site_GetData(site_args));

	// Сохранить данные, необходимые для BX_Site_New:
		sTemp.Format("Site_New:%lu\n", oc_site.GetObjectID());					sFile += sTemp;
		SaveField(sTemp,  site_args.OwnerID,			"OwnerID");					sFile += sTemp;		
		SaveField(sTemp,  NA,								"Profile");					sFile += sTemp;		
		SaveField(sTemp,  site_args.Name,				"Name");						sFile += sTemp;		
		SaveField(sTemp,  site_args.objPassword,		"objPassword");			sFile += sTemp;		
		SaveField(sTemp,  site_args.URL,					"URL");						sFile += sTemp;		
		SaveField(sTemp,  NA,								"objFromID");				sFile += sTemp;		
	//- - - - - - - - - - - - - - - - - - - - - - - - - - -]
		sFile += FUNCTION_DELIMITER;
	//- - - - - - - - - - - - - - - - - - - - - - - - - - -]
	// Сохранить данные, необходимые для BX_Site_PutData:
		sTemp.Format("Site_PutData:%lu\n", oc_site.GetObjectID());				sFile += sTemp;

		SaveField(sTemp,  site_args.objID,						"objID");			sFile += sTemp;
		SaveField(sTemp,  site_args.objPassword,				"objPassword");	sFile += sTemp;
		SaveField(sTemp,  site_args.MirrorInclude,			"MirrorInclude");	sFile += sTemp;
		SaveField(sTemp,  site_args.MirrorExclude,			"MirrorExclude");	sFile += sTemp;
		SaveField(sTemp,  site_args.MirrorSubstr,				"MirrorSubstr");	sFile += sTemp;
		SaveField(sTemp,  site_args.IgnoredIP,					"IgnoredIP");		sFile += sTemp;
		SaveField(sTemp,  site_args.Alias,						"Alias");			sFile += sTemp;
		SaveField(sTemp,  site_args.Name,						"Name");				sFile += sTemp;
		SaveField(sTemp,  site_args.Description,				"Description");	sFile += sTemp;
		SaveField(sTemp,  site_args.URL,							"URL");				sFile += sTemp;
		SaveField(sTemp,  site_args.CounterType,				"CounterType");	sFile += sTemp;
		SaveField(sTemp,  site_args.RateMySite,				"RateMySite");		sFile += sTemp;
		SaveField(sTemp,  site_args.RateStatsViewPassword,	"RateStatsViewPassword");sFile += sTemp;
		SaveField(sTemp,  site_args.ShowAudience,				"ShowAudience");	sFile += sTemp;
		SaveField(sTemp,  NA,										"Profile");			sFile += sTemp;
		SaveField(sTemp,  site_args.Keyword,					"Keyword");			sFile += sTemp;
		SaveField(sTemp,  site_args.Concept,					"Concept");			sFile += sTemp;
		SaveField(sTemp,  site_args.PageName,					"PageName");		sFile += sTemp;
	}

	sFile.WriteFile(BACKUP_FILENAME);

	return BX_OK;
}
Exemplo n.º 8
0
void  Life(void)
{
   int   Running=0;
   int   ViewStep=10;
   unsigned key;

   OwDisplay(Root);
   OwDisplay(StatusWin);

   Center();
   DisplayField();
   do
   {
      MoveCursor((unsigned)(PosX-ShiftX),(unsigned)(PosY-ShiftY));
      CursorType(C_NORMAL);
      if(Running)
      {
         if(KeyPressed())
            key=ReadKey();
         else
            key=' ';
      }
      else
         key=ReadKey();
      switch(key)
      {
      case('!'):
         SuspendInterface();
#ifndef MSDOS
/*       system("exec $SHELL");*/
#else
         system(getenv("COMSPEC"));
#endif
         ResumeInterface();
         continue;
      case(K_F2):
         SaveField();
         continue;
      case('c'):
      case('C'):     /* clear field */
         Running=0;
         FreeField();
         Center();
         break;
      case(' '):
         Step();
         break;
      case('\t'):
         ChangeCell(PosX,PosY,REV);
         break;
      case(M_BUTTON):
         switch(I_LastButton)
         {
         case(LEFT_BUTTON):
            ChangeCell(ShiftX+I_MouseX,ShiftY+I_MouseY,REV);
            break;
         case(RIGHT_BUTTON):
            ShiftX+=I_MouseX-(int)(I_ScreenWidth>>1);
            ShiftY+=I_MouseY-(int)(I_ScreenHeight>>1);
            break;
         default:
            continue;
         }
         break;
      case(M_MOVE):
         if(I_Buttons&LEFT_BUTTON)
            ChangeCell(ShiftX+I_MouseX,ShiftY+I_MouseY,REV);
         else
            continue;
         break;
      case('4'):
         ShiftX-=ViewStep;
         break;
      case(K_LEFT):
         PosX--;
         if(PosX<ShiftX)
            ShiftX-=ViewStep;
         else
         {
            StatusLine();
            continue;
         }
         break;
      case('8'):
         ShiftY-=ViewStep;
         break;
      case(K_UP):
         PosY--;
         if(PosY<ShiftY)
            ShiftY-=ViewStep;
         else
         {
            StatusLine();
            continue;
         }
         break;
      case('6'):
         ShiftX+=ViewStep;
         break;
      case(K_RIGHT):
         PosX++;
         if(PosX>=ShiftX+(int)I_ScreenWidth)
            ShiftX+=ViewStep;
         else
         {
            StatusLine();
            continue;
         }
         break;
      case('2'):
         ShiftY+=ViewStep;
         break;
      case(K_DOWN):
         PosY++;
         if(PosY>=ShiftY+(int)I_ScreenHeight)
            ShiftY+=ViewStep;
         else
         {
            StatusLine();
            continue;
         }
         break;
      case('5'):
         Center();
         break;
      case('3'):
         ShiftY+=ViewStep;
         ShiftX+=ViewStep;
         break;
      case('1'):
         ShiftY+=ViewStep;
         ShiftX-=ViewStep;
         break;
      case('7'):
         ShiftY-=ViewStep;
         ShiftX-=ViewStep;
         break;
      case('9'):
         ShiftY-=ViewStep;
         ShiftX+=ViewStep;
         break;
      case('\r'):
         Running=!Running;
         break;
      case('q'):
      case('Q'):
      case(27):
         return;
      default:
         continue;
      }
      if(PosY<ShiftY)
         PosY+=(ShiftY-PosY+ViewStep-1)/ViewStep*ViewStep;
      if(PosX<ShiftX)
         PosX+=(ShiftX-PosX+ViewStep-1)/ViewStep*ViewStep;
      if(PosY>=ShiftY+(int)I_ScreenHeight)
         PosY-=(PosY-ShiftY-(int)I_ScreenHeight+ViewStep)/ViewStep*ViewStep;
      if(PosX>=ShiftX+(int)I_ScreenWidth)
         PosX-=(PosX-ShiftX-(int)I_ScreenWidth+ViewStep)/ViewStep*ViewStep;;
      DisplayField();
   }
   while(1);
}
Exemplo n.º 9
0
void User::SaveMaxSimDown()
{
  SaveField("max sim down");
}
Exemplo n.º 10
0
void User::SaveMaxUpSpeed()
{
  SaveField("max up speed");
}
Exemplo n.º 11
0
void User::SaveMaxDownSpeed()
{
  SaveField("max down speed");
}
Exemplo n.º 12
0
void User::SaveTagline()
{
  SaveField("tagline");
}
Exemplo n.º 13
0
void User::SaveComment()
{
  SaveField("comment");
}
Exemplo n.º 14
0
void User::SaveNumLogins()
{
  SaveField("num logins");
}
Exemplo n.º 15
0
void User::SaveIdleTime()
{
  SaveField("idle time");
}
Exemplo n.º 16
0
void User::SaveExpires()
{
  SaveField("expires");
}
Exemplo n.º 17
0
void User::SaveMaxSimUp()
{
  SaveField("max sim up");
}
Exemplo n.º 18
0
void User::SaveRatio()
{
  SaveField("ratio");
}
Exemplo n.º 19
0
void User::SaveStartUpDir()
{
  SaveField("startup dir");
}