Post Pacific  

Go Back   Post Pacific > Восстановленный архив > Темы без сохранившегося раздела

Notices

 
 
Thread Tools Search this Thread Display Modes
Old 12.09.2006, 22:01   #1
SlayeR
Архивный участник
 
Join Date: Oct 2005
Posts: 19
Default

First off, GREAT job, works nearly flawless in SQL2000. Few things I noticed, other then a few spelling mistakes (doesn't seem like you speak fluent english, but great job with translations!).
1. I keep getting disconnected after a certain period of inactivity, so you need to Disconnect then Reconnect the client to get new petitions. Really annoying when you are trying to monitor petitions for an extended period of time.
2. Cant seem to figure out the "Head GM" login_flag, maybe put that in the documentation? Keeps giving me errors trying to edit or read other petitions from other GM accounts. :P
3. Submitting a petition does not take away from your '4' petitions daily.
4. There are always 11-12 petitions open.

One question on my mind: Is this "Safe", Anti-SQL inject,etc.

Cant really think of anything more yet, great job though. Keep up the great work!
SlayeR is offline  
Old 09.10.2006, 01:39   #2
Sauron
Архивный участник
 
Join Date: Feb 2005
Posts: 357
Default

Quote:
Originally Posted by SlayeR View Post
3. Submitting a petition does not take away from your '4' petitions daily.
this will do the trick

Code:
/* To prevent any potential data loss issues, you should review this script in detail before running it outside the context of the database designer.*/
BEGIN TRANSACTION
SET QUOTED_IDENTIFIER ON
SET ARITHABORT ON
SET NUMERIC_ROUNDABORT OFF
SET CONCAT_NULL_YIELDS_NULL ON
SET ANSI_NULLS ON
SET ANSI_PADDING ON
SET ANSI_WARNINGS ON
COMMIT
BEGIN TRANSACTION
GO
CREATE TABLE dbo.UserPetitions
	(
	account_id int NULL,
	amount int NULL
	)  ON [PRIMARY]
GO
COMMIT

insert into UserPetitions values(0,20061008);

IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[up_Server_GetCurrentQuota]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'
-- =============================================
-- Author:		<Sauron>
-- Create date: <10.8.2006>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[up_Server_GetCurrentQuota]
	-- Add the parameters for the stored procedure here
@accountuid int
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

	declare @today int;
	set @today = (select (year(getdate()) * 100 + dbo.FormatNumber(month(getdate())))*100+dbo.FormatNumber(day(getdate())));

	if(SELECT amount FROM UserPetitions WHERE account_id=0) <> @today
	begin
		DELETE FROM UserPetitions WHERE account_id <> 0;
		UPDATE UserPetitions SET amount = @today WHERE account_id = 0;
		SELECT 0 as amount;
 	end;
	else
		SELECT isnull( sum(amount) , 0) as amount FROM UserPetitions WHERE account_id = @accountuid;

END
' 
END

IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[up_Server_UpdateQuota]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'
-- =============================================
-- Author:		<Sauron>
-- Create date: <10.8.2006>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[up_Server_UpdateQuota]
	-- Add the parameters for the stored procedure here
@accountuid int,
@amount int
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

	declare @today int;
	set @today = (select (year(getdate()) * 100 + dbo.FormatNumber(month(getdate())))*100+dbo.FormatNumber(day(getdate())));

	if(SELECT amount FROM UserPetitions WHERE account_id=0) <> @today
	begin
		DELETE FROM UserPetitions WHERE account_id <> 0;
		UPDATE UserPetitions SET amount = @today WHERE account_id = 0;
 	end;
	else
	begin
		if exists(select * from UserPetitions where account_id = @accountuid)
			UPDATE UserPetitions SET amount = amount + @amount WHERE account_id = @accountuid;
		else
			INSERT INTO UserPetitions values(@accountuid,1);
	end;
END
' 
END
Quote:
Originally Posted by SlayeR View Post
4. There are always 11-12 petitions open.
i saw the same problem on retail C5 server



any idea about evaluate? i saw it enable just ones and dunno why -_-
Sauron is offline  
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 20:15.