winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
January 2007
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
4 participants
893 discussions
Start a n
N
ew thread
Alexandre Julliard : ntdll: Avoid inter-process APCs when called for the process itself.
by Alexandre Julliard
19 Jan '07
19 Jan '07
Module: wine Branch: master Commit: f3cb4f7d9419d25f3b430cbf935f61bc214c00aa URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f3cb4f7d9419d25f3b430cbf9…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Jan 18 15:41:05 2007 +0100 ntdll: Avoid inter-process APCs when called for the process itself. --- dlls/ntdll/sync.c | 313 +++++++++++++++++++++------------------- include/wine/server_protocol.h | 3 +- server/protocol.def | 1 + server/thread.c | 26 ++-- server/trace.c | 3 +- 5 files changed, 188 insertions(+), 158 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=f3cb4f7d9419d25f3b430…
1
0
0
0
Alexandre Julliard : ntdll: Get rid of the no longer used is_current_process function.
by Alexandre Julliard
19 Jan '07
19 Jan '07
Module: wine Branch: master Commit: 9d09e699d6614a5e3fbb565aaa78d86667e46f8c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9d09e699d6614a5e3fbb565aa…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Jan 18 15:18:12 2007 +0100 ntdll: Get rid of the no longer used is_current_process function. --- dlls/ntdll/ntdll_misc.h | 2 -- dlls/ntdll/virtual.c | 21 --------------------- 2 files changed, 0 insertions(+), 23 deletions(-) diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h index 4a8c474..443b281 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h @@ -120,8 +120,6 @@ extern NTSTATUS VIRTUAL_HandleFault(LPCV extern void VIRTUAL_SetForceExec( BOOL enable ); extern void VIRTUAL_UseLargeAddressSpace(void); -extern BOOL is_current_process( HANDLE handle ); - /* code pages */ extern int ntdll_umbstowcs(DWORD flags, const char* src, int srclen, WCHAR* dst, int dstlen); extern int ntdll_wcstoumbs(DWORD flags, const WCHAR* src, int srclen, char* dst, int dstlen, diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c index 0ac8bdc..f2dd299 100644 --- a/dlls/ntdll/virtual.c +++ b/dlls/ntdll/virtual.c @@ -1212,27 +1212,6 @@ static NTSTATUS map_image( HANDLE hmappi /*********************************************************************** - * is_current_process - * - * Check whether a process handle is for the current process. - */ -BOOL is_current_process( HANDLE handle ) -{ - BOOL ret = FALSE; - - if (handle == NtCurrentProcess()) return TRUE; - SERVER_START_REQ( get_process_info ) - { - req->handle = handle; - if (!wine_server_call( req )) - ret = ((DWORD)reply->pid == GetCurrentProcessId()); - } - SERVER_END_REQ; - return ret; -} - - -/*********************************************************************** * virtual_init */ void virtual_init(void)
1
0
0
0
Alexandre Julliard : ntdll: Implementation of inter-process NtMapViewOfSection and NtUnmapViewOfSection .
by Alexandre Julliard
19 Jan '07
19 Jan '07
Module: wine Branch: master Commit: 02e2fa77985b1e4994a13c79e58d7d8ec209c6ca URL:
http://source.winehq.org/git/wine.git/?a=commit;h=02e2fa77985b1e4994a13c79e…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Jan 18 15:17:51 2007 +0100 ntdll: Implementation of inter-process NtMapViewOfSection and NtUnmapViewOfSection. --- dlls/kernel32/tests/virtual.c | 60 ++++++++++++++++++++++++++++++++++++++++ dlls/ntdll/sync.c | 20 +++++++++++++ dlls/ntdll/virtual.c | 44 +++++++++++++++++++++++------ include/wine/server_protocol.h | 33 +++++++++++++++++++++- server/protocol.def | 31 ++++++++++++++++++++ server/thread.c | 16 ++++++++++ server/trace.c | 18 ++++++++++++ 7 files changed, 212 insertions(+), 10 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=02e2fa77985b1e4994a13…
1
0
0
0
Alexandre Julliard : ntdll: Implementation of inter-process RtlCreateUserThread.
by Alexandre Julliard
19 Jan '07
19 Jan '07
Module: wine Branch: master Commit: 8025f79ce1f787813aa92cd19c999e171e18cf13 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8025f79ce1f787813aa92cd19…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Jan 18 15:02:55 2007 +0100 ntdll: Implementation of inter-process RtlCreateUserThread. --- dlls/kernel32/tests/thread.c | 28 ++++++--------- dlls/ntdll/sync.c | 14 +++++++ dlls/ntdll/thread.c | 23 ++++++++++-- include/wine/server_protocol.h | 21 ++++++++++- server/protocol.def | 19 +++++++++- server/thread.c | 78 +++++++++++++++++++++++++++------------- server/trace.c | 11 ++++++ 7 files changed, 146 insertions(+), 48 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=8025f79ce1f787813aa92…
1
0
0
0
Alexandre Julliard : ntdll: Abuse RtlCreateUserThread to call the thread function for CreateThread directly .
by Alexandre Julliard
19 Jan '07
19 Jan '07
Module: wine Branch: master Commit: 7a383cf83f1f2896f67352a76c07b13510baff1d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7a383cf83f1f2896f67352a76…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Jan 18 15:02:11 2007 +0100 ntdll: Abuse RtlCreateUserThread to call the thread function for CreateThread directly. --- dlls/kernel32/thread.c | 49 +----------------------------------------------- dlls/ntdll/thread.c | 48 +++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 45 insertions(+), 52 deletions(-) diff --git a/dlls/kernel32/thread.c b/dlls/kernel32/thread.c index 4f2594c..cdbe1e1 100644 --- a/dlls/kernel32/thread.c +++ b/dlls/kernel32/thread.c @@ -45,42 +45,6 @@ #include "kernel_private.h" WINE_DEFAULT_DEBUG_CHANNEL(thread); -WINE_DECLARE_DEBUG_CHANNEL(relay); - - -struct new_thread_info -{ - LPTHREAD_START_ROUTINE func; - void *arg; -}; - - -/*********************************************************************** - * THREAD_Start - * - * Start execution of a newly created thread. Does not return. - */ -static void CALLBACK THREAD_Start( void *ptr ) -{ - struct new_thread_info *info = ptr; - LPTHREAD_START_ROUTINE func = info->func; - void *arg = info->arg; - - RtlFreeHeap( GetProcessHeap(), 0, info ); - - if (TRACE_ON(relay)) - DPRINTF("%04x:Starting thread (entryproc=%p)\n", GetCurrentThreadId(), func ); - - __TRY - { - ExitThread( func( arg ) ); - } - __EXCEPT(UnhandledExceptionFilter) - { - TerminateThread( GetCurrentThread(), GetExceptionCode() ); - } - __ENDTRY -} /*********************************************************************** @@ -120,22 +84,13 @@ HANDLE WINAPI CreateRemoteThread( HANDLE CLIENT_ID client_id; NTSTATUS status; SIZE_T stack_reserve = 0, stack_commit = 0; - struct new_thread_info *info; - - if (!(info = RtlAllocateHeap( GetProcessHeap(), 0, sizeof(*info) ))) - { - SetLastError( ERROR_NOT_ENOUGH_MEMORY ); - return 0; - } - info->func = start; - info->arg = param; if (flags & STACK_SIZE_PARAM_IS_A_RESERVATION) stack_reserve = stack; else stack_commit = stack; status = RtlCreateUserThread( hProcess, NULL, TRUE, NULL, stack_reserve, stack_commit, - THREAD_Start, info, &handle, &client_id ); + (PRTL_THREAD_START_ROUTINE)start, param, &handle, &client_id ); if (status == STATUS_SUCCESS) { if (id) *id = (DWORD)client_id.UniqueThread; @@ -147,7 +102,6 @@ HANDLE WINAPI CreateRemoteThread( HANDLE if (NtResumeThread( handle, &ret )) { NtClose( handle ); - RtlFreeHeap( GetProcessHeap(), 0, info ); SetLastError( ERROR_NOT_ENOUGH_MEMORY ); handle = 0; } @@ -155,7 +109,6 @@ HANDLE WINAPI CreateRemoteThread( HANDLE } else { - RtlFreeHeap( GetProcessHeap(), 0, info ); SetLastError( RtlNtStatusToDosError(status) ); handle = 0; } diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c index 4d99195..b06d1a3 100644 --- a/dlls/ntdll/thread.c +++ b/dlls/ntdll/thread.c @@ -43,6 +43,7 @@ #include "wine/exception.h" WINE_DEFAULT_DEBUG_CHANNEL(thread); +WINE_DECLARE_DEBUG_CHANNEL(relay); /* info passed to a starting thread */ struct startup_info @@ -349,6 +350,47 @@ static PUNHANDLED_EXCEPTION_FILTER get_u } /*********************************************************************** + * call_thread_func + * + * Hack to make things compatible with the thread procedures used by kernel32.CreateThread. + */ +static void DECLSPEC_NORETURN call_thread_func( PRTL_THREAD_START_ROUTINE rtl_func, void *arg ) +{ + LPTHREAD_START_ROUTINE func = (LPTHREAD_START_ROUTINE)rtl_func; + DWORD exit_code; + BOOL last; + + MODULE_DllThreadAttach( NULL ); + + if (TRACE_ON(relay)) + DPRINTF( "%04x:Starting thread proc %p (arg=%p)\n", GetCurrentThreadId(), func, arg ); + + exit_code = func( arg ); + + /* send the exit code to the server */ + SERVER_START_REQ( terminate_thread ) + { + req->handle = GetCurrentThread(); + req->exit_code = exit_code; + wine_server_call( req ); + last = reply->last; + } + SERVER_END_REQ; + + if (last) + { + LdrShutdownProcess(); + exit( exit_code ); + } + else + { + LdrShutdownThread(); + server_exit_thread( exit_code ); + } +} + + +/*********************************************************************** * start_thread * * Startup routine for a newly created thread. @@ -397,7 +439,7 @@ static void start_thread( struct wine_pt { __TRY { - MODULE_DllThreadAttach( NULL ); + call_thread_func( func, arg ); } __EXCEPT(get_unhandled_exception_filter()) { @@ -406,9 +448,7 @@ static void start_thread( struct wine_pt __ENDTRY } else - MODULE_DllThreadAttach( NULL ); - - func( arg ); + call_thread_func( func, arg ); }
1
0
0
0
Alexandre Julliard : ntdll: Move the LDT section to ntdll and make it an uninterruptible section.
by Alexandre Julliard
19 Jan '07
19 Jan '07
Module: wine Branch: master Commit: 21d631e2708649fabca672ed450cc15f1eca6dc7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=21d631e2708649fabca672ed4…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Jan 18 15:01:45 2007 +0100 ntdll: Move the LDT section to ntdll and make it an uninterruptible section. --- dlls/kernel32/kernel_main.c | 26 -------------------------- dlls/ntdll/thread.c | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 26 deletions(-) diff --git a/dlls/kernel32/kernel_main.c b/dlls/kernel32/kernel_main.c index f6eeba9..9f6b311 100644 --- a/dlls/kernel32/kernel_main.c +++ b/dlls/kernel32/kernel_main.c @@ -43,29 +43,6 @@ extern int __wine_set_signal_handler(unsigned, int (*)(unsigned)); -static CRITICAL_SECTION ldt_section; -static CRITICAL_SECTION_DEBUG critsect_debug = -{ - 0, 0, &ldt_section, - { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList }, - 0, 0, { (DWORD_PTR)(__FILE__ ": ldt_section") } -}; -static CRITICAL_SECTION ldt_section = { &critsect_debug, -1, 0, 0, 0, 0 }; - -/*********************************************************************** - * locking for LDT routines - */ -static void ldt_lock(void) -{ - RtlEnterCriticalSection( &ldt_section ); -} - -static void ldt_unlock(void) -{ - RtlLeaveCriticalSection( &ldt_section ); -} - - /*********************************************************************** * KERNEL thread initialisation routine */ @@ -141,9 +118,6 @@ static BOOL process_attach(void) } #endif - /* initialize LDT locking */ - wine_ldt_init_locking( ldt_lock, ldt_unlock ); - /* finish the process initialisation for console bits, if needed */ __wine_set_signal_handler(SIGINT, CONSOLE_HandleCtrlC); diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c index 356ba11..4d99195 100644 --- a/dlls/ntdll/thread.c +++ b/dlls/ntdll/thread.c @@ -63,6 +63,41 @@ static ULONG sigstack_zero_bits; struct wine_pthread_functions pthread_functions = { NULL }; + +static RTL_CRITICAL_SECTION ldt_section; +static RTL_CRITICAL_SECTION_DEBUG critsect_debug = +{ + 0, 0, &ldt_section, + { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList }, + 0, 0, { (DWORD_PTR)(__FILE__ ": ldt_section") } +}; +static RTL_CRITICAL_SECTION ldt_section = { &critsect_debug, -1, 0, 0, 0, 0 }; +static sigset_t ldt_sigset; + +/*********************************************************************** + * locking for LDT routines + */ +static void ldt_lock(void) +{ + sigset_t sigset; + + pthread_functions.sigprocmask( SIG_BLOCK, &server_block_set, &sigset ); + RtlEnterCriticalSection( &ldt_section ); + if (ldt_section.RecursionCount == 1) ldt_sigset = sigset; +} + +static void ldt_unlock(void) +{ + if (ldt_section.RecursionCount == 1) + { + sigset_t sigset = ldt_sigset; + RtlLeaveCriticalSection( &ldt_section ); + pthread_functions.sigprocmask( SIG_SETMASK, &sigset, NULL ); + } + else RtlLeaveCriticalSection( &ldt_section ); +} + + /*********************************************************************** * init_teb */ @@ -285,6 +320,10 @@ HANDLE thread_init(void) wine_server_fd_to_handle( 1, GENERIC_WRITE|SYNCHRONIZE, OBJ_INHERIT, ¶ms.hStdOutput ); wine_server_fd_to_handle( 2, GENERIC_WRITE|SYNCHRONIZE, OBJ_INHERIT, ¶ms.hStdError ); } + + /* initialize LDT locking */ + wine_ldt_init_locking( ldt_lock, ldt_unlock ); + return exe_file; }
1
0
0
0
appdb/include application.php
by WineHQ
19 Jan '07
19 Jan '07
ChangeSet ID: 30893 CVSROOT: /opt/cvs-commit Module name: appdb Changes by: wineowner(a)winehq.org 2007/01/18 19:42:56 Modified files: include : application.php Log message: Alexander Nicolaysen Sørnes <alex(a)thehandofagony.com> Display url links using url::display() Patch:
http://cvs.winehq.org/patch.py?id=30893
Old revision New revision Changes Path 1.86 1.87 +3 -12 appdb/include/application.php Index: appdb/include/application.php diff -u -p appdb/include/application.php:1.86 appdb/include/application.php:1.87 --- appdb/include/application.php:1.86 19 Jan 2007 1:42:56 -0000 +++ appdb/include/application.php 19 Jan 2007 1:42:56 -0000 @@ -631,22 +631,13 @@ class Application { echo " <tr class=\"color1\"><td><b>URL</b></td><td>".$appLinkURL."</td></tr>\n"; // optional links - $result = query_parameters("SELECT * FROM appData WHERE appId = '?' AND versionID = 0 AND type = 'url'", - $this->iAppId); - if($result && mysql_num_rows($result) > 0) - { - echo " <tr class=\"color1\"><td> <b>Links</b></td><td>\n"; - while($oRow = mysql_fetch_object($result)) - { - echo " <a href='$oRow->url'>".substr(stripslashes($oRow->description),0,30)."</a> <br />\n"; - } - echo " </td></tr>\n"; - } + if($sUrls = url::display(NULL, $this->iAppId)) + echo $sUrls; // image $img = Screenshot::get_random_screenshot_img($this->iAppId, null, false); echo "<tr><td align=\"center\" colspan=\"2\">$img</td></tr>\n"; - + echo " </table>\n"; /* close of name/vendor/bugs/url table */ echo " </td></tr>\n";
1
0
0
0
appdb/unit_test run_tests.php test_url.php
by WineHQ
19 Jan '07
19 Jan '07
ChangeSet ID: 30892 CVSROOT: /opt/cvs-commit Module name: appdb Changes by: wineowner(a)winehq.org 2007/01/18 19:41:01 Modified files: unit_test : run_tests.php Added files: unit_test : test_url.php Log message: Alexander Nicolaysen Sørnes <alex(a)thehandofagony.com> Unit test for url::update() Patch:
http://cvs.winehq.org/patch.py?id=30892
Old revision New revision Changes Path 1.9 1.10 +2 -0 appdb/unit_test/run_tests.php Added 1.1 +0 -0 appdb/unit_test/test_url.php Index: appdb/unit_test/run_tests.php diff -u -p appdb/unit_test/run_tests.php:1.9 appdb/unit_test/run_tests.php:1.10 --- appdb/unit_test/run_tests.php:1.9 19 Jan 2007 1:41: 1 -0000 +++ appdb/unit_test/run_tests.php 19 Jan 2007 1:41: 1 -0000 @@ -22,4 +22,6 @@ echo "\n"; include_once("test_error_log.php"); echo "\n"; include_once("test_filter.php"); +echo "\n"; +include_once("test_url.php"); ?> Index: appdb/unit_test/test_url.php diff -u -p /dev/null appdb/unit_test/test_url.php:1.1 --- /dev/null 19 Jan 2007 1:41: 1 -0000 +++ appdb/unit_test/test_url.php 19 Jan 2007 1:41: 1 -0000 @@ -0,0 +1,73 @@ +<?php + +/* Unit tests for functions in include/url.php */ + +require_once("path.php"); +require_once("test_common.php"); + +function test_url_update() +{ + test_start(__FUNCTION__); + + global $test_email, $test_password; + + $bSuccess = true; // default to success until we detect failure + + /* Log in */ + $oUser = new User(); + if($retval = $oUser->login($test_email, $test_password) != SUCCESS) + { + echo "Received '$retval' instead of SUCCESS('".SUCCESS."')."; + return FALSE; + } + + $iAppId = 655000; + $iVersionId = 655000; + + $oUser->addPriv("admin"); + + $oUrl = new Url(); + $oUrl->create("Bad description", "
http://www.badurl.com/
", $iVersionId, $iAppId, TRUE); + + $sDescriptionNew = "Good description"; + $sUrlNew = "
http://www.goodurl.com/
"; + $iAppIdNew = $iAppId + 1; + $iVersionIdNew = $iVersionId + 1; + + $oUrl->update($sDescriptionNew, $sUrlNew, $iVersionIdNew, $iAppIdNew, TRUE); + + if($oUrl->sDescription != $sDescriptionNew) + { + echo "Description is '$oUrl->sDescription' instead of '$sDescriptionNew'\n"; + $bSuccess = false; + } + + if($oUrl->sUrl != $sUrlNew) + { + echo "Url is '$oUrl->sUrl' instead of '$sUrlNew'\n"; + $bSuccess = false; + } + + if($oUrl->iVersionId != $iVersionIdNew) + { + echo "VersionId is '$oUrl->iVersionId' instead of '$iVersionIdNew'\n"; + $bSuccess = false; + } + + if($oUrl->iAppId != $iAppIdNew) + { + echo "AppId is '$oUrl->iAppId' instead of '$iAppIdNew'\n"; + $bSuccess = false; + } + + $oUrl->delete(TRUE); + + return $bSuccess; +} + +if(!test_url_update()) + echo "test_url_update() failed!\n"; +else + echo "test_url_update() passed\n"; + +?>
1
0
0
0
appdb/include url.php
by WineHQ
19 Jan '07
19 Jan '07
ChangeSet ID: 30891 CVSROOT: /opt/cvs-commit Module name: appdb Changes by: wineowner(a)winehq.org 2007/01/18 19:40:17 Modified files: include : url.php Log message: Alexander Nicolaysen Sørnes <alex(a)thehandofagony.com> Various small fixes for url class. Add silent parameters for create() and update(). Add and use canEdit(). Fix queue status on create(). Patch:
http://cvs.winehq.org/patch.py?id=30891
Old revision New revision Changes Path 1.12 1.13 +54 -28 appdb/include/url.php Index: appdb/include/url.php diff -u -p appdb/include/url.php:1.12 appdb/include/url.php:1.13 --- appdb/include/url.php:1.12 19 Jan 2007 1:40:17 -0000 +++ appdb/include/url.php 19 Jan 2007 1:40:17 -0000 @@ -49,32 +49,35 @@ class Url { /** * Creates a new url. */ - function create($sDescription = null, $sUrl = null, $iVersionId = null, $iAppId = null) + function create($sDescription = null, $sUrl = null, $iVersionId = null, $iAppId = null, $bSilent = false) { global $aClean; // Security, if we are not an administrator or a maintainer, the url must be queued. - if(!($_SESSION['current']->hasPriv("admin") || $_SESSION['current']->isMaintainer($aClean['iVersionId']) || $_SESSION['current']->isSupermaintainer($aClean['iAppId']))) - { + if(($iAppId && !url::canEdit(NULL, $iAppId)) || + ($iVersionId && !url::canEdit($iVersionId))) $this->bQueued = true; - } - $hResult = query_parameters("INSERT INTO appData (appId, versionId, type, description,". - "queued, submitterId) VALUES ('?', '?', '?', '?', '?', '?')", - $iAppId, $iVersionId, "url", $sDescription, $this->bQueued, - $_SESSION['current']->iUserId); - if($hResult) - { - $this->iUrlId = mysql_insert_id(); - $this->url($this->iUrlId,$this->bQueued); - $this->SendNotificationMail(); - return true; - } - else + $hResult = query_parameters("INSERT INTO appData (appId, versionId, type, + description, queued, submitterId, url) + VALUES ('?', '?', '?', '?', '?', '?', '?')", + $iAppId, $iVersionId, "url", $sDescription, + $this->bQueued ? "true" : "false", + $_SESSION['current']->iUserId, $sUrl); + + if(!$hResult) { addmsg("Error while creating a new url.", "red"); return false; } + + $this->iUrlId = mysql_insert_id(); + $this->url($this->iUrlId,$this->bQueued); + + if(!$bSilent) + $this->SendNotificationMail(); + + return true; } @@ -88,15 +91,19 @@ class Url { WHERE id = '?' AND type = 'url' LIMIT 1"; - if($hResult = query_parameters($sQuery, $this->iUrlId)) - { - if(!$bSilent) - $this->SendNotificationMail(true); - } - if($this->iSubmitterId) + if(!$hResult = query_parameters($sQuery, $this->iUrlId)) + return false; + + if(!$bSilent) + $this->SendNotificationMail(true); + + if($this->iSubmitterId && + $this->iSubmitterId != $_SESSION['current']->iUserId) { $this->mailSubmitter(true); } + + return true; } @@ -125,8 +132,12 @@ class Url { * Update url. * Returns true on success and false on failure. */ - function update($sDescription = null, $sUrl = null, $iVersionId = null, $iAppId = null) + function update($sDescription = null, $sUrl = null, $iVersionId = null, $iAppId = null, $bSilent = false) { + if(!$this->iUrlId) + return FALSE; + + $sWhatChanged = ""; if ($sDescription && $sDescription!=$this->sDescription) @@ -140,8 +151,8 @@ class Url { if ($sUrl && $sUrl!=$this->sUrl) { - if (!query_parameters("UPDATE appData SET noteDesc = '?' WHERE id = '?'", - $sDescription, $this->iUrlId)) + if (!query_parameters("UPDATE appData SET url = '?' WHERE id = '?'", + $sUrl, $this->iUrlId)) return false; $sWhatChanged .= "Url was changed from ".$this->sUrl." to ".$sUrl.".\n\n"; $this->sUrl = $sUrl; @@ -169,7 +180,7 @@ class Url { $sWhatChanged .= "Application was changed from ".$oAppBefore->sName." to ".$oAppAfter->sName.".\n\n"; $this->iAppId = $iAppId; } - if($sWhatChanged) + if($sWhatChanged && !$bSilent) $this->SendNotificationMail("edit",$sWhatChanged); return true; } @@ -181,7 +192,7 @@ class Url { if($this->iSubmitterId) { - $sAppName = Application::lookup_name($this->appId)." ".Version::lookup_name($this->versionId); + $sAppName = Application::lookup_name($this->iAppId)." ".Version::lookup_name($this->iVersionId); $oSubmitter = new User($this->iSubmitterId); if(!$bRejected) { @@ -202,7 +213,7 @@ class Url { function SendNotificationMail($bDeleted=false) { - $sAppName = Application::lookup_name($this->appId)." ".Version::lookup_name($this->versionId); + $sAppName = Application::lookup_name($this->iAppId)." ".Version::lookup_name($this->iVersionId); if(!$bDeleted) { if(!$this->bQueued) @@ -236,6 +247,21 @@ class Url { mail_appdb($sEmail, $sSubject ,$sMsg); } + function canEdit($iVersionId, $iAppId = NULL) + { + $oUser = new User($_SESSION['current']->iUserId); + + if($oUser->hasPriv("admin") || ($iVersionId && + maintainer::isUserMaintainer($oUser, $iVersionId)) || ($iAppId && + maintainer::isSuperMaintainer($oUser, $iAppId))) + { + return TRUE; + } else + { + return FALSE; + } + } + /* Display links for a given version/application */ function display($iVersionId, $iAppId = NULL) {
1
0
0
0
appdb/. updatevote.php
by WineHQ
19 Jan '07
19 Jan '07
ChangeSet ID: 30890 CVSROOT: /opt/cvs-commit Module name: appdb Changes by: wineowner(a)winehq.org 2007/01/18 18:54:13 Modified files: . : updatevote.php Log message: Alexander Nicolaysen Sørnes <alex(a)thehandofagony.com> Fix voting to use $aClean and not $_POST Patch:
http://cvs.winehq.org/patch.py?id=30890
Old revision New revision Changes Path 1.7 1.8 +1 -1 appdb/updatevote.php Index: appdb/updatevote.php diff -u -p appdb/updatevote.php:1.7 appdb/updatevote.php:1.8 --- appdb/updatevote.php:1.7 19 Jan 2007 0:54:13 -0000 +++ appdb/updatevote.php 19 Jan 2007 0:54:13 -0000 @@ -10,7 +10,7 @@ require("path.php"); require(BASE."include/incl.php"); require(BASE."include/vote.php"); -vote_update($_POST); +vote_update($aClean); apidb_footer(); ?>
1
0
0
0
← Newer
1
...
19
20
21
22
23
24
25
...
90
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
Results per page:
10
25
50
100
200