Orientation in ipad1

Basic issue:
My game is in default landscape. However in ipad 1 and 2 it plays in portrait. Traced the issue back to here. So it would be nice if we check wether the user has any orientation preferences given in config file.

if landscape and portrait both valeus are same then we check status bar orientation
else we give in to user preferred orientation