diff --git a/.hgignore b/.hgignore
new file mode 100644
index 0000000000..b61636dd2b
--- /dev/null
+++ b/.hgignore
@@ -0,0 +1,18 @@
+# use glob syntax
+syntax: glob
+
+*.obj
+*.exe
+*.pdb
+*.user
+*.aps
+*.pch
+*.vspscc
+[Bb]in
+[Db]ebug*/
+obj/
+[Rr]elease*/
+_ReSharper*/
+[Tt]est[Rr]esult*
+[Bb]uild[Ll]og.*
+*.[Pp]ublish.xml
diff --git a/umbraco.suo b/umbraco.suo
new file mode 100644
index 0000000000..bcd5d23a23
Binary files /dev/null and b/umbraco.suo differ
diff --git a/umbraco/presentation/Web.SLACEBOX.config b/umbraco/presentation/Web.SLACEBOX.config
new file mode 100644
index 0000000000..49c948647f
--- /dev/null
+++ b/umbraco/presentation/Web.SLACEBOX.config
@@ -0,0 +1,210 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/umbraco/presentation/umbraco/webservices/api/DocumentService.asmx b/umbraco/presentation/umbraco/webservices/api/DocumentService.asmx
new file mode 100644
index 0000000000..dcb6614dda
--- /dev/null
+++ b/umbraco/presentation/umbraco/webservices/api/DocumentService.asmx
@@ -0,0 +1 @@
+<%@ WebService Language="C#" CodeBehind="DocumentService.asmx.cs" Class=umbraco.webservices.documents.documentService %>
\ No newline at end of file
diff --git a/umbraco/presentation/umbraco/webservices/api/FileService.asmx b/umbraco/presentation/umbraco/webservices/api/FileService.asmx
new file mode 100644
index 0000000000..e8a68ff354
--- /dev/null
+++ b/umbraco/presentation/umbraco/webservices/api/FileService.asmx
@@ -0,0 +1 @@
+<%@ WebService Language="C#" CodeBehind="FileService.asmx.cs" Class="umbraco.webservices.files.fileService" %>
diff --git a/umbraco/presentation/umbraco/webservices/api/MaintanceService.asmx b/umbraco/presentation/umbraco/webservices/api/MaintanceService.asmx
new file mode 100644
index 0000000000..fc9f8aba21
--- /dev/null
+++ b/umbraco/presentation/umbraco/webservices/api/MaintanceService.asmx
@@ -0,0 +1 @@
+<%@ WebService Language="C#" CodeBehind="MaintanceService.asmx.cs" Class="umbraco.webservices.maintenance.maintenanceService" %>
diff --git a/umbraco/presentation/umbraco/webservices/api/MediaService.asmx b/umbraco/presentation/umbraco/webservices/api/MediaService.asmx
new file mode 100644
index 0000000000..cfaded1cb1
--- /dev/null
+++ b/umbraco/presentation/umbraco/webservices/api/MediaService.asmx
@@ -0,0 +1 @@
+<%@ WebService Language="C#" CodeBehind="MediaService.asmx.cs" Class="umbraco.webservices.media.mediaService" %>
diff --git a/umbraco/presentation/umbraco/webservices/api/MemberService.asmx b/umbraco/presentation/umbraco/webservices/api/MemberService.asmx
new file mode 100644
index 0000000000..f65beb00c6
--- /dev/null
+++ b/umbraco/presentation/umbraco/webservices/api/MemberService.asmx
@@ -0,0 +1 @@
+<%@ WebService Language="C#" CodeBehind="MemberService.asmx.cs" Class="umbraco.webservices.members.memberService" %>
diff --git a/umbraco/presentation/umbraco/webservices/api/StylesheetService.asmx b/umbraco/presentation/umbraco/webservices/api/StylesheetService.asmx
new file mode 100644
index 0000000000..4d98082f6c
--- /dev/null
+++ b/umbraco/presentation/umbraco/webservices/api/StylesheetService.asmx
@@ -0,0 +1 @@
+<%@ WebService Language="C#" CodeBehind="StylesheetService.asmx.cs" Class="umbraco.webservices.stylesheets.stylesheetService" %>
diff --git a/umbraco/presentation/umbraco/webservices/api/TemplateService.asmx b/umbraco/presentation/umbraco/webservices/api/TemplateService.asmx
new file mode 100644
index 0000000000..8af78e62dd
--- /dev/null
+++ b/umbraco/presentation/umbraco/webservices/api/TemplateService.asmx
@@ -0,0 +1 @@
+<%@ WebService Language="C#" CodeBehind="TemplateService.asmx.cs" Class="umbraco.webservices.templates.templateService" %>
diff --git a/umbraco/presentation/umbracobase/restExtension.cs b/umbraco/presentation/umbracobase/restExtension.cs
index 7fde8acfe1..e079a00e53 100644
--- a/umbraco/presentation/umbracobase/restExtension.cs
+++ b/umbraco/presentation/umbracobase/restExtension.cs
@@ -1,22 +1,9 @@
using System;
-using System.Data;
-using System.Text;
-using System.Text.RegularExpressions;
-using System.Configuration;
-using System.Web;
-using System.Web.Security;
-using System.Web.UI;
-using System.Web.UI.WebControls;
-using System.Web.UI.WebControls.WebParts;
-using System.Web.UI.HtmlControls;
+using System.Linq;
using System.Reflection;
-using System.Collections.Specialized;
using System.Xml;
-
-using umbraco;
-using umbraco.cms.businesslogic;
+using umbraco.BusinessLogic.Utils;
using umbraco.cms.businesslogic.member;
-using umbraco.cms.businesslogic.property;
using umbraco.IO;
namespace umbraco.presentation.umbracobase
@@ -60,7 +47,8 @@ namespace umbraco.presentation.umbracobase
set { _isAllowed = value; }
}
- public bool returnXML {
+ public bool returnXML
+ {
get { return _returnXml; }
set { _returnXml = value; }
}
@@ -107,55 +95,59 @@ namespace umbraco.presentation.umbracobase
{
//check for RestExtensionAttribute
- foreach(Type t in BusinessLogic.Utils.TypeFinder.FindClassesMarkedWithAttribute(typeof(RestExtension)))
+ foreach (Type t in TypeFinder.FindClassesMarkedWithAttribute(typeof(RestExtension)))
{
-
- var temp = t.GetCustomAttributes(typeof(RestExtension), false);
- if(((RestExtension)temp[0]).GetAlias() == extensionAlias)
+ var temp = t.GetCustomAttributes(typeof(RestExtension), false).OfType();
+
+ if (temp.Where(x => x.GetAlias() == extensionAlias)
+ .Any())
{
+
MethodInfo mi = t.GetMethod(methodName);
- if (mi == null)
- {
- //method not found
- }
- else
+ if (mi != null)
{
//check allowed
- var attri = mi.GetCustomAttributes(typeof(RestExtensionMethod), false);
+ var attributes = mi.GetCustomAttributes(typeof(RestExtensionMethod), false).OfType();
- fromFile = false;
-
- allowed = ((RestExtensionMethod)attri[0]).allowAll;
-
- if (!allowed)
+ //check to make sure the method was decorated properly
+ if (attributes.Any())
{
- //Member Based permissions.. check for group, type and ID...
- Member currentMem = Member.GetCurrentMember();
+ fromFile = false;
- //not basic.. and not logged in? - out..
- if (currentMem == null)
+ var attribute = attributes.First();
+ allowed = attribute.allowAll;
+
+ if (!allowed)
{
- allowed = false;
- }
- else //do member authentication stuff...
- allowed = memberAuthentication(((RestExtensionMethod)attri[0]), currentMem);
- }
+ //Member Based permissions.. check for group, type and ID...
+ Member currentMem = Member.GetCurrentMember();
- if (allowed)
- {
- this.isAllowed = true;
- this.alias = extensionAlias;
- this.assembly = t.Assembly;
- this.method = t.GetMethod(methodName);
- this.type = t;
+ //not basic.. and not logged in? - out..
+ if (currentMem == null)
+ {
+ allowed = false;
+ }
+ else
+ {
+ //do member authentication stuff...
+ allowed = memberAuthentication(attribute, currentMem);
+ }
+ }
+
+ if (allowed)
+ {
+ this.isAllowed = true;
+ this.alias = extensionAlias;
+ this.assembly = t.Assembly;
+ this.method = t.GetMethod(methodName);
+ this.type = t;
+ }
}
}
-
}
}
-
}
if (allowed)
@@ -194,8 +186,8 @@ namespace umbraco.presentation.umbracobase
if (!string.IsNullOrEmpty(baseExt.GetAllowGroup()))
{
-
- //Groups array
+
+ //Groups array
string[] groupArray = baseExt.GetAllowGroup().Split(',');
foreach (MemberGroup mg in currentMem.Groups.Values)
@@ -206,14 +198,14 @@ namespace umbraco.presentation.umbracobase
memberAccess = true;
}
}
-
+
}
//Membertype allowed?
if (!string.IsNullOrEmpty(baseExt.GetAllowType()) && !memberAccess)
{
-
- //Types array
+
+ //Types array
string[] typeArray = baseExt.GetAllowType().Split(',');
foreach (string type in typeArray)
@@ -221,17 +213,17 @@ namespace umbraco.presentation.umbracobase
if (type == currentMem.ContentType.Alias)
memberAccess = true;
}
-
+
}
//Member ID allowed? should this work with loginName instead?
- if (!string.IsNullOrEmpty(baseExt.GetAllowMember())&& !memberAccess)
+ if (!string.IsNullOrEmpty(baseExt.GetAllowMember()) && !memberAccess)
{
if (int.Parse((string)baseExt.GetAllowMember().Trim()) == currentMem.Id)
memberAccess = true;
-
+
}
return memberAccess;
}
@@ -287,6 +279,6 @@ namespace umbraco.presentation.umbracobase
}
return memberAccess;
}
-
+
}
}
diff --git a/umbraco/presentation/web.config b/umbraco/presentation/web.config
new file mode 100644
index 0000000000..49c948647f
--- /dev/null
+++ b/umbraco/presentation/web.config
@@ -0,0 +1,210 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file