I want to Zend_Auth and Zend_Session to save user sessions and logins information
whats the easy and best way for implements following items:
1-Disallow multiple concurrent logins for the specific user
2-List all of all user currently logged in
3-Admin could logout of specific user or destroy specific session
Is there any special ZF or PHP API or library that can do the above?
thanks
I am trying to page through a results from an REST API call that supports paging. I would like the UI to just be a list view that as I scroll, the new content is retrieved.
Hi,
I have a question for which I'm sure there must a simple solution. I'm writing a small GWT application where I want to achieve this:
www.domain.com : should serve the welcome page
www.domain.com/xyz : should serve page xyz, where xyz is just
a key for an item in a database. If there is an
item associated with key xyz, I'll load that and show a page, otherwise I'll show a
404 error page.
I was trying to modify the web.xml file accordingly but I just couldn't
make it work. I could make it work with an url-pattern if the key in question is after another /, for example: www.domain.com/search/xyz. However,
I'd like to have the key xyz directly following the root / (http://www.domain.com/xyz).
Something like
<servlet-mapping>
<servlet-name>main</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
doesn't seem to work as I don't know how to address the main page
index.html (as it's not an actual servlet) which will then load my
main GWT module.
I could make it work with a bad work around (see below): Redirecting a
404 exception to index.html and then doing the look up in the main
entry point, but I'm sure that's not the best practice, also for SEO
purposes.
Can anyone give me a hint on how to configure the web.xml with GWT for
my purpose?
Thanks a lot.
Mike
Work-around via 404:
Web.xml:
<web-app>
<error-page>
<exception-type>404</exception-type>
<location>/index.html</location>
</error-page>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
</web-app>
index.html -- Main Entry point -- onModuleLoad():
String path = Window.Location.getPath();
if (path == null || path.length() == 0 || path.equalsIgnoreCase("/")
|| path.equalsIgnoreCase("/index.html")) {
... // load main page
} else {
lookup(path.substring(1)); // that's key xyz
hi all,
i'm branding an iphone app and the designer wants to display list items using Georgia. This is not a big deal, but he wants them do appear as small-caps..
is this possible to do in iPhone os3?
I have a factory class to build objects of base class B.
The object (D) that uses this factory received a list of strings representing the actual types.
What is the correct implementation:
the factory receives an Enum (and uses switch inside the Create function) and D is responsible to convert the string to Enum.
the factory receives a string and checks for a match to a set of valid strings (using ifs')
other implementation i didn't think of.
Problem is that i cant convert to string
Dim path As String = "..\..\..\Tier1 downloads\CourseVB\"
If countNumberOfFolders > 0 Then 'if there is a folder then
' make a reference to a directory
Dim di As New IO.DirectoryInfo(path)
Dim diar1 As IO.DirectoryInfo() = di.GetDirectories()
Dim dra As IO.DirectoryInfo
'list the names of all files in the specified directory
For Each dra In diar1
Dim lessonDirectoryName() As Lesson
lessonDirectoryName(0).lessonName = dra
Next
'the the lesson is an object, and lessonName is the property of type string. How do i convert the directoryInfo to string?
I would like for the "List" view content views to have a check added to it to first check that the model has elements, it occurs to me that I have no idea how these views are generated. Can those be changed?
I'm trying to export 2 values from every single item from the combo box field.
I have found two methods to insert items into a combo box:
1) insertItemAt
http://www.verypdf.com/document/acrobat-forms-javascript/pg_0048.htm
2) setItems
http://livedocs.adobe.com/acrobat_sdk/9/Acrobat9_HTMLHelp/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Acrobat9_HTMLHelp&file=JS_API_AcroJS.88.748.html
but neither method allows two parameters (im always get "missing ) after argument list" error from the Acrobat JavaScript Debugger)
Does anyone know of a better solution for this problem? Thanks!
Hello,
I have a folder with .txt files in it. How can i make my menuitem get those .txt files and put the filenames in the menuitem, so that it creates a list of all .txt files in that folder.
So when i put a .txt in the folder the program automaticly creates the menu item.
Does someone knows how to do this, or perhaps an example?
Does anyone know where I can go to get a list of the new TFS 2010 features.
NOTE: I need TFS 2010 features. Not Visual Studio 2010.
My boss is wondering why not just upgrade to Visual Studio 2010 and not worry about updating TFS from 2008 to 2010. (VS2010 is compatable with TFS 2008.)
Any input would be nice.
Hi,
I am able to list Documents from "Public Folders"
Using this sample code :
session.LogonExchangeMailbox("[email protected]", "server");
RDOFolder folder = session.GetFolderFromPath(@"\Public Folders\All Public Folders");
Now i want to Extract this documents to another location.
Is there a way to get all format parameters of a string?
I have this string: "{0} test {0} test2 {1} test3 {2:####}"
The result should be a list:
{0}
{0}
{1}
{2:####}
Is there any built in functionality in .net that supports this?
I am going to choose a JMS message broker for a project. It is critical that the JMS server is stable and can handle a high load of messages. I have narrowed down the list to include Active MQ and JBoss Messaging.
I was wondering if any of you have any experience with any of these or even better have tried both of them in the same environment. Any link to a research paper or similar would be nice.
So I have 2 interfaces:
A node that can have children
public interface INode
{
IEnumeration<INode> Children { get; }
void AddChild(INode node);
}
And a derived "Data Node" that can have data associated with it
public interface IDataNode<DataType> : INode
{
DataType Data;
IDataNode<DataType> FindNode(DataType dt);
}
Keep in mind that each node in the tree could have a different data type associated with it as its Data (because the INode.AddChild function just takes the base INode)
Here is the implementation of the IDataNode interface:
internal class DataNode<DataType> : IDataNode<DataType>
{
List<INode> m_Children;
DataNode(DataType dt)
{
Data = dt;
}
public IEnumerable<INode> Children
{
get { return m_Children; }
}
public void AddChild(INode node)
{
if (null == m_Children)
m_Children = new List<INode>();
m_Children.Add(node);
}
public DataType Data { get; private set; }
Question is how do I implement the FindNode function without knowing what kinds of DataType I will encounter in the tree?
public IDataNode<DataType> FindNode(DataType dt)
{
throw new NotImplementedException();
}
}
As you can imagine something like this will not work out
public IDataNode<DataType> FindNode(DataType dt)
{
IDataNode<DataType> result = null;
foreach (var child in Children)
{
if (child is IDataNode<DataType>)
{
var datachild = child as IDataNode<DataType>;
if (datachild.Data.Equals(dt))
{
result = child as IDataNode<DataType>;
break;
}
}
else
{
// What??
}
}
return result;
}
Is my only option to do this when I know what kinds of DataType a particular tree I use will have? Maybe I am going about this in the wrong way, so any tips are appreciated. Thanks!
I have a script that is designed to parse XML postbacks from Ultracart, right now just dumps it into a MySQL table. The script works fine if I point it to a XML file on my localhost but using 'php://input' it doesn't seem to grabbing anything. My logs show apache returning 200 after the post so I have no idea what could be wrong or how to drill down the issue.. here's the code:
$doc = new DOMDocument();
$doc->loadXML($page);
$handle = fopen("test2/".time().".xml", "w+");
fwrite($handle,trim($page)); // it doesn't save this either :'(
fclose();
require_once('includes/database.php');
$db = new Database('localhost', 'user', 'password', 'db_name');
$data = array();
$exports = $doc->getElementsByTagName("export");
foreach ($exports as $export) {
$orders = $export->getElementsByTagName("order");
foreach($orders as $order) {
$data['order_id'] = $order->getElementsByTagName("order_id")->item(0)->nodeValue;
$data['payment_status'] = $order->getElementsByTagName("payment_status")->item(0)->nodeValue;
$date_array = explode(" ",$order->getElementsByTagName("payment_date_time")->item(0)->nodeValue);
if ($date_array[1] == 'JAN') { $date_array[1] = '01'; }
if ($date_array[1] == 'FEB') { $date_array[1] = '02'; }
if ($date_array[1] == 'MAR') { $date_array[1] = '03'; }
if ($date_array[1] == 'APR') { $date_array[1] = '04'; }
if ($date_array[1] == 'MAY') { $date_array[1] = '05'; } // converts Ultracart date to
if ($date_array[1] == 'JUN') { $date_array[1] = '06'; } // MySQL date
if ($date_array[1] == 'JUL') { $date_array[1] = '07'; }
if ($date_array[1] == 'AUG') { $date_array[1] = '08'; }
if ($date_array[1] == 'SEP') { $date_array[1] = '09'; }
if ($date_array[1] == 'OCT') { $date_array[1] = '10'; }
if ($date_array[1] == 'NOV') { $date_array[1] = '11'; }
if ($date_array[1] == 'DEC') { $date_array[1] = '12'; }
$data['payment_date'] = $date_array[2]."-".$date_array[1]."-".$date_array[0];
$data['payment_time'] = $date_array[3];
//... we'll skip this, there are 80 some elements
$data['discount'] = $order->getElementsByTagName("discount")->item(0)->nodeValue;
$data['distribution_center_code'] = $order->getElementsByTagName("distribution_center_code")->item(0)->nodeValue;
}
}
}
$db->insert('order_history',$data);
} else die('ERROR: Token Check Failed!');
I'm using System.DirectoryServices to list the status of websites running on a server. Currently I'm using impersonation of an admin account for this to run but I'd prefer to have a specific user account with the bare minimum privileges.
Can anyone point me in the right direction?
I have some viewdata that is generated by going through my repository to the database to grab some scheduling info. When the information is stored in the Viewdata, I noticed that the viewdata is enumerated. How could I access the enumerated items and generate a table/list based on the viewdata? Most of the information just needs to be spit out into a table, but one item will have a link generated for it.
Thanks!
I have the following code:
f = open(path, 'r')
html = f.read() # no parameters => reads to eof and returns string
soup = BeautifulSoup(html)
schoolname = soup.findAll(attrs={'id':'ctl00_ContentPlaceHolder1_SchoolProfileUserControl_SchoolHeaderLabel'})
print schoolname
which gives:
[<span id="ctl00_ContentPlaceHolder1_SchoolProfileUserControl_SchoolHeaderLabel">A B Paterson College, Arundel, QLD</span>]
when I try and access the value (i.e. 'A B Paterson College, Arundel, QLD) by using schoolname['value'] I get the following error:
print schoolname['value'] TypeError: list indices must be integers, not str
What am I doing wrong to get that value?
i have a list of thumbnails!
i am able to rotate a image with jquery, but after i refresh the page, the image is the same!
i want to make a SAVE button to save all the edited images?
how i can save the edited image on the server side?
thanks
Hi I installed VS2010 yesterday - (both VS2005 and VS2010 installed).
But I can't find the "FixedSys" style font from the Fonts and Colors - Font (pull down list).
Otherwise,I can use the style font in my VS2005.
Any suggestion? Thank you.
I have the adminpak.msi installed so that I can use the Remote Desktop MMC to connect to all of my servers. As I add a server, it goes to the bottom of the list of available servers. I can't find out how to re-order them into more logical groupings, or at least alphabetical. Any ideas?
Hi,
i have a listener like this:
$('.delete').click(function() {
...some stuff
});
also, on the same page, another script dinamically add elements to the DOM in this way:
$('#list').append('<tr><td><a class="delete" href="#">delete</a></td></tr>');
my problem is that the listener doesn't "listen" to these dinamically created elements.
anyone can shed a light please :'(
I'd like to be able to use ruby's OptionParser to parse sub-commands of the form
COMMAND [GLOBAL FLAGS] [SUB-COMMAND [SUB-COMMAND FLAGS]]
like:
git branch -a
gem list foo
I know I could switch to a different option parser library (like Trollop), but I'm interested in learning how to do this from within OptionParser, since I'd like to learn the library better.
Any tips?
Hi guys,
I have a question about the JFileChooser in Swing. I'm trying to get multiple file extensions in the drop-down box, but have no idea how to do it.
There is the method
extFilter = FileNameExtensionFilter(description, extensions);
that I can then use by writing
fileChooser.setFileFilter(extFilter);
however, as you can see, this only supports one option in the drop-down list. How do I add more?